[Dynamic Host Configuration Protocol (DHCP) failover in Windows Server](https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/hh831385(v=ws.11)) https://activedirectorypro.com/dhcp-best-practices/ [DHCP Best Practices - Microsoft Learn](https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2003/cc780311(v=ws.10)?redirectedfrom=MSDN) # PowerShell Commands ### Install DHCP Role ``` Install-WindowsFeature -IncludeManagementTools DHCP ``` ### Backup DHCP Server ``` Backup-DhcpServer -ComputerName "dhcp1.ad.activedirectorypro.com" -Path "C:\Windows\system32\dhcp\backup" ``` ### View DHCP leases ``` Get-DhcpServerv4Scope | Get-DhcpServerv4Lease ``` ### Find DHCP Lease from MAC Address ``` Get-DhcpServerv4Scope |Get-DhcpServerv4Lease |where {$_.ClientId -like “b4-b6-86-b4-**-**” } ``` ### Add DHCP Scope ``` Add-DHCPServerv4Scope -EndRange 10.2.1.254 -Name Vlan110 -StartRange 10.2.1.1 -SubnetMask 255.255.255.0 -State Active ``` ### Get all active ipv4 scopes ``` Get-DHCPServerv4Scope ``` ### Get all DHCP reservations for a scope ``` Get-DHCPServerv4Lease -ScopeId 10.2.1.0 ``` ### Create a DHCP reservation ``` Get-DhcpServerv4Lease -ComputerName dhcpserver1 -IPAddress 10.2.1.8 | Add-DhcpServerv4Reservation -ComputerName server1 ```