Last active
August 29, 2015 14:01
-
-
Save Dan1el42/b553ad3a51e8fef025d6 to your computer and use it in GitHub Desktop.
Set the DNS suffix search list via CIM (remote or local) without group policy. Most relevant for Win2008 R2 and earlier. Win2012 and later comes with cmdlets.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $WsmanSession = New-CimSession -ComputerName 'Win2008R2Server', 'Win2012Server', 'Win2012R2Server' | |
| $DcomSession = New-CimSession -ComputerName 'WinXP', 'Win2003Server' -SessionOption (New-CimSessionOption -Protocol Dcom) | |
| $InvokeSplat = @{ | |
| CimSession = $WsmanSession, $DcomSession | |
| ClassName = 'Win32_NetworkAdapterConfiguration' | |
| MethodName = 'SetDNSSuffixSearchOrder' | |
| Arguments = @{DNSDomainSuffixSearchOrder=@('contoso.lab','viamonstra.lab')} | |
| } | |
| Invoke-CimMethod @InvokeSplat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment