Set Agent failover between management servers

get a list of Agents from current Primary Management Server

$agents = get-agent | where {$_.PrimaryManagementServerName -eq “ms1.opsmgr.net”}

Set the Primary Management Server

$pri = get-managementserver | where-object {$_.PrincipalName -eq “ms1.opsmgr.net”}

Set the secondary management Server

$sec = get-managementserver | where-object {$_.PrincipalName -eq “ms2.opsmgr.net”}

Set up failover between the management servers

set-managementserver -agentmanagedcomputer $agents -primarymanagementserver $pri -failoverserver $sec

Word of caution: Make sure the primary of the secondary is currently the actual managing server so communication stays up. rerun again if you want to change to a new server.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s