In Windows Server 2012, Microsoft added DHCP failover feature. However, this feature will not replicate MAC filter lists (Allow/Deny). Below script is to synchronize DHCP MAC filter database. Link to original post: http://sysadminreference.blogspot.com/2014/02/dhcp-fail-over-service-do-not.html
Paste below script in Powershell ISE
[code language=”powershell”]
$MasterServerHostname = "MasterDHCPFQDN";
# Get the LOCAL filters from localhost
$lfilters = Get-DhcpServerv4Filter
# Get the REMOTE filters from $MasterServerHostname
$rfilters = invoke-command -computername $MasterServerHostname { Get-DhcpServerv4Filter }
# Delete the local Filter Set
#ForEach ($filter in $rfilters) {
# Remove-DhcpServerv4Filter -MacAddress $filter.MacAddress
#}
# Import the new Filter Set
ForEach ($filter in $rfilters) {
write-host $filter.List
write-host $filter.MacAddress;
write-host $filter.Description
Add-DhcpServerv4Filter -List $filter.List -Force -MacAddress $filter.MacAddress -Description $filter.Description
}[/code]
Script to check number of MAC address record, to ensure all DHCP servers having the same number (optional)
[code language=”powershell”]del C:\MAC\LocalMacList.txt
Get-DhcpServerv4Filter -List Allow > C:\MAC\LocalMacList.txt
Get-Content C:\MAC\LocalMacList.txt | Measure-Object[/code]