Created
December 9, 2009 07:35
-
-
Save tckz/252334 to your computer and use it in GitHub Desktop.
Powershell+WMIでDNS操作
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
$dns = gwmi -Class MicrosoftDNS_server -Namespace Root\MicrosoftDNS -ComputerName DCコンピュータ名 | |
$rrs = gwmi -Class MicrosoftDNS_ResourceRecord -Namespace Root\MicrosoftDNS -ComputerName DCコンピュータ名 |
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
$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