Windows Server 2012 and Windows Server 2012 R2 has new DHCP cmdlets which include export and import tasks based on PowerShell.
- Export-DhcpServer
- Import-DhcpServer
To export the DHCP server configuration, scopes and leases from a Windows Server 2008, Windows Server 2008 R2 or Windows Server 2012 to Windows Server 2012 R2, run the following command from the Windows Server 2012 R2 powershell console.
Export-DhcpServer –ComputerName “mycurrentdhcpserver.mydomain.com” -Leases -File C:\dhcpexp.xml -verbose
If you do not want export lease information, do not include –Leases switch.
Once the export task is finish Stop the DHCP service in the current DHCP server (mycurrentdhcpserver.mydomain.com)
Net stop dhcpserver
Install DHCP Server role on your NEW Windows Server 2012 R2.
Install-WindowsFeature -IncludeManagementTools dhcp
To import DHCP server configuration to Windows Server 2012 R2, run the following command from the Windows Server 2012 R2 powershell console.
Import-DhcpServer –ComputerName “myNEWdhcpserver.mydomain.com” -Leases –File C:\dhcpexp.xml -BackupPath D:\dhcp\backup\ -Verbose
Deja un comentario