Ying Li at myITforum.com

PowerShell & System Center

Using SCOM Command Shell to Configure Gateway Server Failover to Multiple Management Servers

In my previous post, I discussed how to configure Agent Failover Between Multiple Gateway Servers using PowerShell. Today, I am going to show an example as to how to configure Gateway Server failover to Multiple Management Servers.

$PrimaryMS = Get-ManagementServer | Where { Your Filter Here}

$failoverMS = Get-ManagementServer | Where { Your Filter Here}

$gatewayMS = Get-ManagementServer | Where { Your Filter Here}

Set-ManagementServer -GatewayManagementServer: $gatewayMS -ManagementServer: $PrimaryMS -FailoverServer: $failoverMS

You could see that this is very similar to my previous script – there is only one line difference. -GatewayManagementServer: $gatewayMS

Comments

yli628 said:

I just test this in OpsMgr 2007 SP1 environment, and the script is slightly different!

The last part should be:

Set-ManagementServer -GatewayManagementServer: $gatewayMS -PrimaryManagementServer: $PrimaryMS -FailoverServer: $failoverMS

Cheers!

# March 27, 2009 10:13 AM