Convert zone to AD-integrated (VBScript)

This code can be found in Chapter 12 of Windows Server 2003 Security Cookbook

Purchase XP Cookbook or Networking Recipes for only $25 plus shipping! While supplies last.

Find out how to download all of the VBScript code from this site.

' ------ SCRIPT CONFIGURATION ------
strZone   = "<ZoneName>"
strServer = "<ServerName>"
' ------ END CONFIGURATION ---------

set objDNS = GetObject("winMgmts:\\" & strServer & "\root\MicrosoftDNS")
set objDNSServer = objDNS.Get("MicrosoftDNS_Server.Name="".""")
set objDNSZone = objDNS.Get("MicrosoftDNS_Zone.ContainerName=""" & _
                          strZone & """,DnsServerName=""" & _
                          objDNSServer.Name & """,Name=""" & strZone & """")
strNull = objDNSZone.ChangeZoneType(0, True)
objDNSZone.Put_
WScript.Echo "Converted " & strZone & " to AD-Integrated"

This code has been viewed 752 times.

New from the creators of TechTasks.com: StatSheet.com