Wednesday, January 30, 2013

[OpsMgr 2012] How to Add and Remove a Management Group - VBS Script

Updated: January 31, 2012
Applies To: System Center 2012 - Operations Manager



In Operations Manager, you can create a script that can add or remove a management group from the agent.

Example

The following is an example script, which is written in VBScript, that adds or removes a management group. For more information about parameters, return values, usage, and errors, see AddManagementGroup Method or RemoveManagementGroup Method.
 
 
 
  1. Option Explicit
  2. Dim objMSConfig
  3. Set objMSConfig = CreateObject("AgentConfigManager.MgmtSvcCfg")
  4. ‘Add a management group
  5. Call objMSConfig.AddManagementGroup ("MyManagementGroupToAdd", "company.sm.net",5723)
  6. ‘Remove a management group
  7. Call objMSConfig.RemoveManagementGroup ("MyManagementGroupToRemove”)

This posting is provided "AS IS" with no warranties.

No comments:

Post a Comment