Hi all,
Can someone point me in the right direction or has anyone a script that will remotely change a host record ip address on an win2003 pri dns server? I need this for a failover DR box.
I've managed to create a new A record, now I just need to find out how to delete the existing record first.
Is this the way to do it or is there a way to just modify the existing record?
strDNSServer = "dnsserverip"strContainer = "domainname.com"strOwner = "host.domainname.com"intRecordClass = 1intTTL = 600 strIPAddress = "hostip" strComputer = "dnsserverip"Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!" & strComputer & _ "rootMicrosoftDNS")
Set objItem = objWMIService.Get("MicrosoftDNS_AType")errResult = objItem.CreateInstanceFromPropertyData _ (strDNSServer, strContainer, strOwner, intRecordClass, _ intTTL, strIPAddress)
Cheers
harrygunter2007-08-03 06:28:29
update ip in a record
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.