I have been asked by my customers, how can they set up their Gateway Server to failover to another Management Server should the Gateway lose communication with the Primary Server. By default, SCOM will not do this leaving your agents in an unmonitored state should the Management Server that communicates with the gateway go offline. Luckily with the use of PowerShell this can be accomplished. Kevin Holman has written about this and you can find the script here.
In this scenario I have two Gateways in my DMZ. Both have a Primary Management server OMMS1.LAB.AD, but do not have a Failover.
I first specify the Gateway Server I want confirm and modify on line 4. Then run the script lines 3-8
This will return what the current values are for the Gateway Server specified.
Now, on line 15 add the desired failover Management Server. Run Lines 14-16.
This added the management server as a failover. Now for confirmation, run lines 6-8 again to confirm the management servers.
You should now see the Primary and Failover Management Server.
Give it some time for the Failover to show in the view. Or you could always restart the health service to speed it up.
Note: if you want to add multiple failovers it will be like the following: