I had to add multiple servers which had to be added to additional Management Group. Since I do not like mouse clicking I decided to find a script that will do the work for me.
I soon found this VBScript written by Bob Cornelissen.
Since I am a PowerShell Guy I wanted to Get-PowerShell-Script and I found Ross Worth PowerShell Script that gives us ability to add single server to Management Group.
I decided to modify the script..
This Is sample how to run my modified script:
AddSCOMAgentToManagementGroup.ps1 -AgentName “Server01″,”Server02” -ManagementGroupName “MGMTNAME” -ManagementServerName “MS01.contoso.com”
The outcome will be something like this:
Adding: Server01 to [String]$ManagementGroupName,
[String]$ManagementServerName Management Group
Or if server was already member of this management group we should get:
Agent: Server02 is Already member of: MGMTNAME
If you are constantly using same Management Server and Management group you can hard code it. Just change part:
If you will hardcode these two values you can run script:
AddSCOMAgentToManagementGroup.ps1 -AgentName “Server01″,”Server02”
Script Can be downloaded from here.
In near future I will add this also to my “Custom SCOM 2012 PowerShell Module”. So stay tuned 😉