SCOM - Move Agents to another Management Server
There are times when you may need to move your agents from one management server to different management server.
This is easily done by right clicking the agent and select Change Primary Management Server.
The problem is that when a agent is manually installed and approved, the Remotely Manageable flag which allows the options Change Primary Management Server, Repair and Uninstall to be used is set to NO. Because this flag is set to NO those options will be greyed out. You could change the database to set the flag to YES but there is a easier solution. Powershell!
In order to move the agents to a different management server first put the agents you want in maintenance mode then open your Operations Manager Shell and follow these steps:
This will move all agents managed by $serverfrom to $serverto
If you want to move only one or a few you can move them like this:
or
Then when you are finished bring the agents back from maintenance mode.
This is easily done by right clicking the agent and select Change Primary Management Server.
The problem is that when a agent is manually installed and approved, the Remotely Manageable flag which allows the options Change Primary Management Server, Repair and Uninstall to be used is set to NO. Because this flag is set to NO those options will be greyed out. You could change the database to set the flag to YES but there is a easier solution. Powershell!
In order to move the agents to a different management server first put the agents you want in maintenance mode then open your Operations Manager Shell and follow these steps:
This will move all agents managed by $serverfrom to $serverto
$serverfrom = Get-ManagementServer | ? {$_.name -eq "FQDN of the Server you are moving the agents from"}
$agents = Get-Agent -ManagementServer $serverfrom
$serverto = Get-ManagementServer | ? {$_.name -eq "FQDN of the Server you are moving the agents to"}
Set-ManagementServer -AgentManagedComputer:$agents -PrimaryManagementServer:$serverto
If you want to move only one or a few you can move them like this:
$agent = Get-Agent -ManagementServer $serverfrom | ? {$_.name -eq "FQDN of the agent"}
or
$agent = Get-Agent -ManagementServer $serverfrom | ? {$_.name -match "some pattern that will match the agents you want"}
Then when you are finished bring the agents back from maintenance mode.
No comments:
Post a Comment