Hi
I am not sure you can remove the relationship if it is in use. Remove scopes first, remove the relationsphip next once you know everything is working fine. This also allows for easy rollback. You never know with modern firewalls and it is easy to forget something.
If you run the command Remove-DhcpServerv4FailoverScope, the scope will remain configured in the system it was run on (use -computer to make sure where to run it) and it will be removed from the partner.
The best way to make sure it works like you want is creating a dummy scope. Use 1.2.3.4 or whatever and test. Once you are confident how it works, run the script on the production scopes.
To migrate the scopes, create a new relationship with the new server if you don't have already one (you will need a scope. Use a dummy one that you will delete afterwards).
For instance:
Add-DhcpServerv4Failover -ScopeId
"5.5.10.0"
-ComputerName
"SurvivingServer"
-Name
"NewRelationshipName"
-PartnerServer
"NewDHCPServer"
-MaxClientLeadTime
"01:00:00"
-SharedSecret
"Redacted"
-Force:$
true
-ServerRole
Active -ReservePercent
20
If it didn't explode, check that both DHCP servers can see each other: Go to the scope (5.5.10.0 in this case), properties, failover and ensure that both partners are "Normal". It's very easy to forget this part and you will have a non-functional setup that looks fine, but it's not working.
Create a reservation, synchronize scopes. They should work. If they don't, check the firewalls.
Make sure the global parameters are set the way you want. Sometimes it is desired to have them different between servers (typically in failover scenarios or for load balancing), but in other occasions it's a problem if they aren't correct or worse, forgotten.
If everything looks fine, use something like this to migrate the scopes.
$vScopes=@(
"10.130.0.0",
"10.130.4.0",
"10.130.6.0",
"10.133.8.0")
foreach ($vScope in $vScopes) {
write-host "Reconfiguring $vScope"
Remove-DhcpServerv4FailoverScope -ComputerName "SurvivingServer" -ScopeId $vScope -name "OldRelationshipName"
Add-DhcpServerv4FailoverScope -ComputerName "SurvivingServer" -ScopeId $vScope -name "NewRelationshipName"
}
If it doesn't work, you can always exchange the relationship names and it is back to the original.
I've migrated close to 50 scopes last month between AD forests using something similar to that script. Your user must have at least DHCP Administrator permissions on both, local and remote server/forest.
Best regards
Seve
Von: ntsys...@googlegroups.com <ntsys...@googlegroups.com>
Im Auftrag von Max Coder
Gesendet: Mittwoch, 8. Januar 2025 12:11
An: ntsysadmin <ntsys...@googlegroups.com>
Betreff: [ntsysadmin] DHCP failover partnership remove
-!-!-!- EXTERNAL EMAIL -!-!-!- This email originated from outside of SKAN. Do not click links or open attachments unless you recognize the sender and know the content is safe
--
You received this message because you are subscribed to the Google Groups "ntsysadmin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
ntsysadmin+...@googlegroups.com.
To view this discussion visit
https://groups.google.com/d/msgid/ntsysadmin/a8a59026-c9f9-42aa-a4e5-b757e7b7e8efn%40googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/ntsysadmin/DBBP189MB13403F9BED1A76EDBF4E4F7DE9122%40DBBP189MB1340.EURP189.PROD.OUTLOOK.COM.