13.4. Converting a Zone to an AD-Integrated Zone
Problem
You want to convert a primary zone to an AD-integrated zone. This causes the contents of the zone to be stored and replicated in Active Directory instead of in a text file.
Solution
Using a graphical user interface
Open the DNS Management snap-in.
Right-click on DNS in the left pane and select Connect to DNS Server.
Enter the server you want to connect to and click Enter.
If you want to convert a forward zone, expand the Forward Lookup Zone folder. If you want to convert a reverse zone, expand the Reverse Lookup Zone folder.
Click on the zone you want to convert, then right-click it and select Properties.
Beside Type, click the Change button.
Check the box beside Store the zone in Active Directory.
Click OK twice.
Using a command-line interface
> dnscmd <ServerName
> /zoneresettype <ZoneName
> /DsPrimary
Using VBScript
' This code converts a zone to AD-integrated. ' ------ SCRIPT CONFIGURATION ------ strZone = "<ZoneName
>" ' e.g. rallencorp.com strServer = "<ServerName
>" ' e.g. dc1.rallencorp.com ' ------ 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"
Get Active Directory Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.