Tuesday, November 23, 2021

How to move DHCP server to new server, how to clear stale leases from DHCP server database

  1.  On old server, open an administrative command prompt and run "netsh dhcp server export c:\temp\dhcp.txt all"
  2. Install the DHCP server role on new server. Do not make any configuration changes after the install, and make sure the DHCP server service is running.
  3. Copy the exported dhcp configuration file from the old server to the c:\temp folder of the new server.
  4. Open an administrative command prompt on the new server and run "netsh dhcp server import c:\temp\dhcp.txt all"
  5. Open the DHCP management console on the new server, right click on the server name, and click "authorize". Make sure that all the settings have imported properly.
  6. Go back to the old server and deauthorize the server. You can then remove the DHCP server role, or just disable the DHCP service permanently.
  7. If you have moved DHCP to a server that will also be a DNS server, remember to include the new server in the DHCP Scope options.


DELETE STALE LEASES FROM DATABASE

  1. Right click IPv4 and choose "reconcile all scopes"
  2. Click "verify" at the bottom
  3. If it lists IP addresses, click "reconcile" at the bottom
  4. Check your active leases. You will see a bunch of them appear which all have the same bogus MAC address. Sort them so they are all in a row, highlight them all, right click and choose "delete".
  5. Your usage statistics should now match the actual amount of IP's that are leased.

No comments:

Post a Comment