This is a VBScript to add a management group entry to a SCOM 2012 agent. This will add a management group entry to an existing Operations Manager 2012 agent.
In order to use it just downlaod the file.
Make sure you edit this part of the script:

"ManagementGroupNameToAdd", "",5723

This should of course reflect the management group name you want to add and the management server and the Operations Manager port you are using.
After that just invoke the script:
cscript.exe AddSCOM2012Mgmntgrp.vbs
It will add the management group entry in a second.

You can find about the story in this blog post: Manipulating SCOM 2012 agent multihoming options by script

Bob Cornelissen