You can automate creating an Active Directory (AD)-integrated zone with forest-wide replication using the Dnscmd utility. However, you must use version 5.2.3790 or later of the Dnscmd utility, which you can find in the Windows Support Tools for Windows Server 2003 (32-bit).

If you're using the correct version of Dnscmd, the following command will create a new AD-integrated zone through a server named DNSSERVER:

dnscmd DNSSERVER /zoneadd 80.16.172.in-addr.arpa /dsprimary /dp /forest

Unfortunately, if you try to use this same command with version 5.1.2600 of Dnscmd, which is in the Windows Support Tools for Windows XP, Dnscmd will silently ignore the /dp switch. Furthermore, this version of Dnscmd will set the zone to replicate only to domain controllers (DCs). If you have any DNS servers that aren't DCs, they won't receive replication updates. (Although this sample command creates a reverse zone, the problem pertains to creating both reverse and forward AD-integrated zones.)

If you're trying to automate zone creation from the command line or a batch file, you can't use the command-line Help file to ensure you have the correct version of Dnscmd. Both versions claim to support the directory partition syntax and will show the Help information in Figure 1 for the /dp switch.


Figure 1: The Help information for Dnscmd's /dp switch (click to enlarge)


Despite what the command-line Help file states, version 5.1.2600 of Dnscmd will neither set up forest-wide replication nor replicate to non-DC DNS servers. So, if you're working from an XP system, check the version of Dnscmd you have before creating a DNS AD-integrated zone. As Figure 2 shows, you can find the version on Dnscmd's properties page.


Figure 2: Finding the version of Dnscmd


If you don't have version 5.1.2600 or later and you don't have the Windows Support Tools for Windows 2003 (32-bit), you can download this tool set from the "Windows Server 2003 Service Pack 1 32-bit Support Tools" web page.