Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DNS A and Pointer records

Status
Not open for further replies.

Brycspain

IS-IT--Management
Mar 9, 2006
150
US
I'm trying to script some DNS Atype and PTRtype data entries. I've thoroughly studied the MSDN Library createInstanceFromPropertydata method and queried DNS for pointer and A records for precise examples and every time I run this script, I recieve a Generic Failure error on the first instance of errResult on line 15. I've run this script in cscript too with no better results.

I'm using domain admin credentials. Am I just approaching this wrong?

Any help would be greatly appreciated.

Code:
strDNSServer = "dnsserver.mydomain.com"
strPTRContainer = "32.1.179.in-addr.arpa"
strAContainer = "mydomain.com"
strPTROwner = "176.32.1.179.in-addr.arpa"
strPTRDomainname = "server" & "." & strAContainer
intRecordClass = 1
intTTL = 600 
strIPAddress = "179.1.32.176"

Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strDNSServer & _
        "\root\MicrosoftDNS")

Set objItem = objWMIService.Get("MicrosoftDNS_Atype")
errResult = objItem.CreateInstanceFrompropertydata _
     (strDNSServer, strAContainer, strPTRDomainname, intRecordClass, intTTL, strIPAddress)


Set objItem1 = objWMIService.Get("MicrosoftDNS_PTRType")
errResult1 = objItem1.CreateInstanceFromPropertyData _
    (strDNSServer, strPTRContainer, strPTROwner, intRecordClass, intTTL, strPTRDomainname)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top