Mombu the Microsoft Forum sponsored links

Go Back   Mombu the Microsoft Forum > Microsoft > how to modify DNS record with script?
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 11th March 01:25
david curwin
External User
 
Posts: 1
Default how to modify DNS record with script?



I want to modify an existing DNS record on a Windows 2003
server (AD Integrated Zone) by means of a script.

I found the following script on the Microsoft site, and
it works fine for creating a record:

-----------------------------------------
strDNSServer = "atl-dc-03.fabrikam.com"
strContainer = "fabrikam.com"
strOwner = "workstation5.fabrikam.com"
intRecordClass = 1
intTTL = 600
strIPAddress = "192.168.1.100"

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer
& "\root\MicrosoftDNS")
Set objItem = objWMIService.Get("MicrosoftDNS_AType")
errResult = objItem.CreateInstanceFromPropertyData _
(strDNSServer, strContainer, strOwner,
intRecordClass, intTTL, strIPAddress)
------------------------------------------

But despite much searching, I have not found a way to
change the email address of an existing
record, or alternatively to delete an existing record
(and then recreate it with the script above.)

I tried using the dnsrecord.vbs included in dnsprov.zip,
but not only was it way too large for me to figure
out how to include a snippet in my own script, I couldn't
get it to modify a record for me at all.

Does anyone have any ideas? On the face of it, it should
be pretty simple.

Thanks,

Dave
  Reply With Quote


  sponsored links


2 11th March 01:25
william stacey
External User
 
Posts: 1
Default how to modify DNS record with script?



Using "dnscmd.exe" and /recorddelete is probably the easiest. They have a
delete example in the vb scripts you talked about. I have a c# example if
that would help, but not a vbs one (other then the one ms has in the dnsprov
sdk.) I would use dnscmd.

--
William Stacey, MVP
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666