This year is coming to its end very soon and as so its time to say goodbye to some old stuff.
For all of you who had to make a SCOM upgrade from 2007 to 2012 by building
separate environments and connecting agent to two Management Groups this article will help.
you know this day will come and you will need to remove the old MG from the new Agent.
This is very simple, all you need is to create one rule and run one task.
As for the rule:
create a Script timed rule and put it on Windows computer class (do not enable it)
in the script write down this strange language :
Set objMSConfig = CreateObject(“AgentConfigManager.MgmtSvcCfg”)
Call objMSConfig.RemoveManagementGroup (“Management Group Name to Remove”)
later I created a group that holds all the servers to be removed and enabled the rule on the group.
The script can run only once and later it will just give an error about it unable to run, its ok, just disable it again.
As the script does it thing a health service restart is needed, the simple way is to add it to the script
but i simply use Reload configuration task on the agent.
Happy new year