Microsoft DHCP Server: Export / Import scope WITH leases

When extending a subnet with Microsoft DHCP you cannot change the SUBNET mask on the already running active scope, you need to export, edit, import 🙂

Open Powershell:

Export specified scopes and their leases

Export-DhcpServer -ComputerName “dhcpserver.contoso.com” -File “C:\exportdir\dhcpexport.xml” -ScopeId 192.168.35.0 -Leases

The open the XML file and search for the subnet:

Change the subnet for your requirements, ex. 255.255.0.0

Now go to the DHCP GUI and DELETE the SCOPE you have just exported – yes delete 🙂 (I am sure you have checked you had the right data in the XML first – right?! 🙂 )

Then run this in powershell:

Import configuration and lease data

Import-DhcpServer -ComputerName “dhcpserver.contoso.com” -File “C:\exports\dhcpexport.xml” -BackupPath “C:\dhcpbackup\” -Leases

Refresh the DHCP GUI and you should find that everything is in place, the subnet, though it’s still greyed out, have changed, and the leases already there by the clients are back, so no network issues will occur! 🙂

Source:

Export-DhcpServer (DhcpServer) | Microsoft Docs

Import-DhcpServer (DhcpServer) | Microsoft Docs

 

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close