Using the Microsoft Management Console (MMC) DHCP snap-in to set up a DHCP server, authorize it, and create a DHCP scope is a fairly trivial task.
Unfortunately, if you have to create and manage dozens if not hundreds of subnets on a regular basis, using a GUI to create DHCP scopes with all the options you want, such as exclusions and reservations, is far from ideal. If you're sick of going through the MMC to create your new DHCP scopes, you'll be glad to hear that you can accomplish the necessary tasks at a command prompt. Windows Server 2003 includes a utility called Netsh that you can use to manipulate DHCP server parameters at the command prompt. This, of course, means that you can script DHCP scope setting and even incorporate it as part of an automated workflow.
Netsh
According to Microsoft's documentation, "Netsh is a command-line scripting utility that allows you to, either locally or remotely, display or modify the network configuration of a computer that is currently running." You can think of Netsh as just another command-line utility like xcopy.exe or net.exe, but it's really more of a command shell similar to Telnet or FTP. In fact, if you open a command prompt and type
netsh
you get a netsh prompt at which you can enter commands interactively with the shell. . . .


In the case of NETSH for DHCP configuration, I always see one ommission regarding using this commandline tool for scripting DHCP configuration, and it can be confounding until you realize what's happening: You cannot configure remote DHCP servers with NETSH unless you have the DHCP service installed locally. In other words, if you try to use NETSH to get to the DHCP configuration commands for a remote server from an XP workstation, the DHCP subset of commands is not available. And if you are on a server without DHCP installed, the commands will also not be available.
Many admins (like myself) install all available Microsoft support tools and ResKit tools, but none of that matters (in this case) if you don't have Microsoft DHCP service installed locally.
If there's some DLL that can be registered to alleviate this, I'd love to hear about it.
-- Rob "I" --
Sr Windows Admin
WintelRobIT September 27, 2007 (Article Rating: