Creating a Windows Server 2012 DHCP Failover Relationship


Here's my quick and simple recipe for creating a Windows Server 2012 DHCP failover relationship.

The following ingredients are required:

  • two Windows Server 2012 DHCP servers with the DHCP role installed
  • two or more scopes already configured as type DHCP on the first DHCP server

 All set? Good, let's cook…

 

Let's configure a Hot-Standby relationship with the first DHCP server as the primary server. First, get the scopes on HALODHCP01:

$Scopes = Get-DhcpServerv4Scope -ComputerName HALODHCP01

 

Next, create the Hot-Standy relationship:

Add-DhcpServerv4Failover -Name "HALO_FAILOVER" -ScopeID $Scopes[0].ScopeID -ComputerName HALODHCP01 -PartnerServer HALODHCP02 -ServerRole Active -AutoStateTransition $True -SharedSecret "8DKSZfF31Q" -Force

 

Now, check the failover out:

Get-DhcpServerv4Failover -ComputerName HALODHCP01

 

Here's stage two – add any additional scopes to the failover. First, get a list of scopes, ignoring the one we used to create the failover:

$ScopeObjects = $Scopes | Select-Object -Skip 1

 

Next, add those scopes to the failover relationship:

$ScopeObjects | ForEach-Object {Add-DhcpServerv4FailoverScope -Name "HALO_FAILOVER" -ComputerName HALODHCP01 -ScopeId $_.ScopeID}

 

Finally, list the scope that are part of the relationship:

(Get-DhcpServerv4Failover -ComputerName HALODC02).ScopeID.IPAddressToString

 

Quick and easy, unlike Lobster Thermidor.

 

Comments (4)

  1. Ed (DareDevil57) says:

    thanks.

  2. There sure is! Thank you 🙂

  3. Me says:

    Thanks
    always interesting

  4. Me says:

    hey btw
    isn't there a typo here:
    HALODHCP001
    HALODHCP01
    ?