Last active
January 6, 2017 21:59
-
-
Save techthoughts2/d51f0ee1bb1c3e4de75fd888241a6df8 to your computer and use it in GitHub Desktop.
DNS Suffixes
This file contains 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
#set suffixes | |
$suffixes = "suffix1.int,suffix2.int,suffix3.int" | |
$command = @" | |
cmd.exe /C "wmic nicconfig call SetDNSSuffixSearchOrder ($domain,$suffixes)" | |
"@ | |
Invoke-Expression -Command:$command -ErrorAction SilentlyContinue | |
#------------------------------------------------------------------------------ | |
#reverse suffixes change | |
#Append Primary and connection specific DNS suffixes | |
#Append parent suffixes of the primary DNS suffix | |
$command = @" | |
cmd.exe /C "wmic nicconfig call SetDNSSuffixSearchOrder" | |
"@ | |
Invoke-Expression -Command:$command -ErrorAction SilentlyContinue | |
#------------------------------------------------------------------------------ | |
#get those suffixes | |
$suffixResults = wmic nicconfig get DNSDomainSuffixSearchOrder |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment