2009-09-17 4 views

Répondre

1
#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

http://myitforum.com/cs2/blogs/yli628/archive/2008/06/19/powershell-script-to-add-multiple-a-records-in-dns.aspx

Questions connexes