How to Display Management Group Information

Updated: January 31, 2012

Applies To: System Center 2012 - Operations Manager

In Operations Manager, you can create a script that can retrieve a management group or a collection of management groups from the agent.

Example

The following is an example script, which is written in VBScript, that displays information about management groups. For more information about parameters, return values, usage, and errors, see GetManagementGroups Method or GetManagementGroup Method.

Option Explicit

Dim objMSConfig
Set objMSConfig = CreateObject("AgentConfigManager.MgmtSvcCfg")

'Get a management group and display the server name
Dim objMG
Set objMG = objMSConfig.GetManagementGroup ("MyManagementGroupToGet”)
MsgBox  objMG.ManagementGroupServer

'Get all management groups and display the port
Dim collMG
Set collMG = objMSConfig.GetManagementGroups()

'Enumerate the collection
Dim mgItem
For Each mgItem In collMG
   MsgBox CInt(objMG.ManagementServerPort)
Next

See Also