For When You Can't Have The Real Thing
[ start | index | login ]
start > Windows > Server > 2012 > DHCP Scope Duplication

DHCP Scope Duplication

Created by dave. Last edited by dave, 9 years and 131 days ago. Viewed 2,372 times. #4
[diff] [history] [edit] [rdf]
labels
attachments
(2014-12-17)

Problem

I have a Windows DHCP server that is reservation-only. I want to duplicate this server's setup on a second server (for redundancy).

Solution

I have a bunch of >>unix-like tools for Windows. They are very handy. And they let me do this:

> netsh dhcp server dump | \local\wbin\egrep -i "scope|optionvalue" | \local\wbin\egrep -vi "#|optiondef" | \local\wbin\sed -e "s/Server1/Server2/g" > scope.txt

...which I think you'll agree is a very fine trick.

This dumps server1's current dhcp server configuration and then edits all scope-related configurations such that they can be fed back to netsh to configure server2. It includes the server-level options as well as the scope options and reservations.

The resulting file can be fed back into netsh, where it will send the appropriate commands to configure server2. Note that you can run this on server1 (as long as server2 is accessible).

There's probably a powershell equivalent to this, but I bet it is at least twice as long.

(Based on >>this)

no comments | post comment
This is a collection of techical information, much of it learned the hard way. Consider it a lab book or a /info directory. I doubt much of it will be of use to anyone else.

Useful:


snipsnap.org | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt