Adding or removing a management group from SCOM 2012 agent using powershell

To remove a management Group from a SCOM 2012 agent run the following commands from an elevated powershell:

$SCOMAgent = New-Object -ComObject AgentConfigManager.MgmtSvcCfg
$SCOMAgent.RemoveManagementGroup("<ManagementGroupName>")

To add a management Group to a SCOM 2012 agent run the following commands from an elevated powershell:

$SCOMAgent = New-Object -ComObject AgentConfigManager.MgmtSvcCfg
$SCOMAgent.AddManagementGroup ("<ManagementGroupName>", "<SCOMServerFQDN>",5723)

 

This entry was posted in SCOM 2012. Bookmark the permalink.