tags:

views:

445

answers:

1

Is it possible to create DNS entries using WMI (Windows Management Instrumentation)?

Thank you

+2  A: 

Maybe this could help: Add DNS Resource

EDIT: Here's a VBScript snippet that might be useful

 var sHostName = "SomeMachine"
 var strRRsufix    = ". IN A 192.168.51.200";  //some ip address
 var strRR= sHostName + strRRsufix;
 var objDNS       = GetObject("winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\MicrosoftDNS");
 var objRR        = objDNS.Get("MicrosoftDNS_ResourceRecord");
 var objDNSServer = objDNS.Get("MicrosoftDNS_Server.Name=\".\"");
 objRR.CreateInstanceFromTextRepresentation(objDNSServer.Name, strDomain, strRR);
ichiban
hmmm I'll try that. Seems like it's not exactly straightforward, especially with impersonation ?!. But thanks alot for digging this up, its a good starting point :)
Alex