Thursday, 26 February 2026

fixing some DHCP scopes

Came across some mis-configured DHCP scopes and needed to resolve. They were working independently duplicate leases and reservations not matching. This was causing issues with WIFI AP's


Backup

mkdir C:\tools\dhcpbackup

cd C:\tools\dhcpbackup

Export-DhcpServer -Leases -File "C:\tools\dhcpbackup\WC-DC03-leases.xml" -Force

Get-DhcpServerv4Reservation -ComputerName WC-DC03 -ScopeId 10.66.33.0 | Export-Csv "C:\tools\dhcpbackup\WC-DC03-reservations.csv" -NoTypeInformation


In a maint window.

Moved all reservations to DC03

Deleted scope on DC04

Setup scope on DC03 as a failover scope and selected DC04 as partner

This will take care of leases

Need to sync reservations manually (can setup a scheduled task to run a script)

$LogFile = "C:\tools\dhcpbackup\dhcp-sync-log.txt"

Invoke-DhcpServerv4FailoverReplication -ComputerName WD-DC03 -ScopeId 10.65.33.0 -Force -ErrorAction Stop


No comments:

Post a Comment