Showing posts from July, 2012

Programming DHCP via NETSH

If you need to configure more than two subnets on a Windows 2008 R2 DHCP server (Or all versions later), doing via the GUI is a painful way to do it.

Here's a simple cut and paste script that you can run via netsh that will make the subnets much quicker.

Launch netsh from the command line, and paste this in:

Replace with your DHCP server, and with your Scope's Network (check the subnet mask and the IP range) 

Just repeat each section below for each subnet.  I find it easy to just use find and replace to make lots of these.

Dhcp Server \\ add scope "Name of the Subnet" "Description of Subnet"
Dhcp Server \\ Scope set state 1
Dhcp Server \\ Scope set delayoffer 0

# ===============================================================
# Start Add Ipranges to the Scope, Server
# ==================================================…