Skip to content

Instantly share code, notes, and snippets.

@gioxx
Created October 12, 2015 11:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gioxx/10f51beeaa3cd77b61b5 to your computer and use it in GitHub Desktop.
Save gioxx/10f51beeaa3cd77b61b5 to your computer and use it in GitHub Desktop.
Batch: Replicate DHCP Reservations (from DHCP1 to DHCP2)
netsh dhcp server dump | findstr reservedip > C:\temp\dhcp1.txt
FOR /F "tokens=1,2,3*" %%a in (C:\temp\listareservation1.txt) do @echo %%a %%b \\SERVERDHCP2 %%d >> C:\temp\dhcp2.txt
netsh -f C:\temp\dhcp2.txt
del C:\temp\dhcp1.txt C:\temp\dhcp2.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment