We ran into an issue recently when running a SCOM Agent installation on a machine that previous had a SCOM agent removed from it.
Basically whenever we put the Management group that was specified on the old SCOM agent I.E. prior uninstall it would error out with below.
“Invalid Management Group name”
This problem occurs when the Management Group name is:
-Empty of Null
-Leading or Trailing spaces
-Already exists on this computer
-Contains special characters. The Management Group name should not contain following special characters:
To Fix this delete the following key in the registry
“HKEY_LOCAL_MACHINESOFTWAREMicrosoftMicrosoft Operations Manager3.0Agent Management Groups<Management Group Name>
After we did this we could install the new SCOM agent fine