Skip to content

Instantly share code, notes, and snippets.

@tckz
Created December 9, 2009 07:35
Show Gist options
  • Save tckz/252334 to your computer and use it in GitHub Desktop.
Save tckz/252334 to your computer and use it in GitHub Desktop.
Powershell+WMIでDNS操作
$dns = gwmi -Class MicrosoftDNS_server -Namespace Root\MicrosoftDNS -ComputerName DCコンピュータ名
$rrs = gwmi -Class MicrosoftDNS_ResourceRecord -Namespace Root\MicrosoftDNS -ComputerName DCコンピュータ名
$cnames = gwmi -Class MicrosoftDNS_CNAMEType -Namespace Root\MicrosoftDNS -ComputerName DCコンピュータ名
$cname = $cnames | ? {$_.OwnerName -eq "cname.example.com"}
$cname.Modify($null, "some.example.com.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment