0
Microsoft DNS Server 2008
中是否有任何API使用VBScript
或PowerShell
或P/Invoke
或添加新的正向DNS
? 很容易生成純文本文件並將其放入\system32\dns
。如何使用API或PowerShell在Windows Server 2008上添加新的DNS區域?
如何用腳本執行替換MMC
中的數字手動命令?
Microsoft DNS Server 2008
中是否有任何API使用VBScript
或PowerShell
或P/Invoke
或添加新的正向DNS
? 很容易生成純文本文件並將其放入\system32\dns
。如何使用API或PowerShell在Windows Server 2008上添加新的DNS區域?
如何用腳本執行替換MMC
中的數字手動命令?
#xyz is dns servername
$A = [wmiclass]"\\xyz\root\MicrosoftDNS:MicrosoftDNS_AType"
$DNSServer = "xyz.R-test.com"
$Zone = "R-Test.com"
$class = 1
$TTL = 3600
#This is your web server IP Address
$IPAddress = "192.168.1.88"
$Sites = Get-content WebSites.txt
Foreach ($Site in $Sites)
{
$A.CreateInstanceFromPropertyData($DNSserver, $zone, $Site, $class, $ttl, $IPAddress)
}
The WebSites.txt is something look like this:
whatever1.R-test.comwhatever2.R-test.comwhatever3.R-test.com
whatever4.R-test.com
…
http://www.highorbit.co.uk/?p=636
http://richardsiddaway.spaces.live.com/blog/cns!43CFA46A74CF3E96!994.entry