Skip to content

Instantly share code, notes, and snippets.

@techthoughts2
Last active January 6, 2017 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save techthoughts2/d51f0ee1bb1c3e4de75fd888241a6df8 to your computer and use it in GitHub Desktop.
Save techthoughts2/d51f0ee1bb1c3e4de75fd888241a6df8 to your computer and use it in GitHub Desktop.
DNS Suffixes
#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