14.2. Authorizing a DHCP Server

Problem

You want to permit (i.e., authorize) a DHCP Server to process DHCP requests from clients. This is necessary only if the DHCP Server is a member of an Active Directory domain.

Solution

Using a graphical user interface

Warning

Windows 2000 DHCP Servers cannot be authorized with the Windows Server 2003 version of the DHCP snap-in unless the DHCP Server has Service Pack 2 or higher installed.

  1. Open the DHCP snap-in.

  2. In the left pane, right-click on DHCP and select Add Server.

  3. Type in the name of the DHCP Server you want to target and click OK.

  4. Click on the server entry in the left pane.

  5. Right-click on the server and select Authorize.

Tip

If the DHCP Server is not a member of an Active Directory domain, you will not see the Authorize option.

Using a command-line interface

The following command authorizes a DHCP Server in Active Directory:

> netsh dhcp add server <DHCPServerName> 
                  <DHCPServerIP>

This example shows how to authorize the DHCP Server named dhcp01.rallencorp.com with IP 192.168.191.15:

> netsh dhcp add server dhcp01.rallencorp.com 192.168.191.15

Using VBScript

See the Introduction for more information on how to run the netsh command from within a script. The following script prints out the list of authorized DHCP Servers in Active Directory:

' ------ SCRIPT CONFIGURATION ------
strForestRootDN = "<ForestRootDN>" ' e.g., dc=rallencorp,dc=com ' ------ END CONFIGURATION --------- set objCont = GetObject("LDAP://CN=DhcpRoot,CN=NetServices,CN=Services," & _ ...

Get Windows Server Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.