We help IT Professionals succeed at work.

SCOM rehome agents to another management server via powershell?

587 Views
Last Modified: 2017-04-09
EE,

I have an issue where a management server keeps crashing and we need to get the agents off.

I'm trying to do it with an article from 2007 but I'm running 2012R2 and the commands are different.

Can someone assist?

$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

$agent = Get-Agent -ManagementServer $serverfrom | ? {$_.name -eq "FQDN of the agent"}
Comment
Watch Question

Simple Geek from the '70s
CERTIFIED EXPERT
Distinguished Expert 2019
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Author

Commented:
You're the man, thanks