OpsMgr 2012 R2 – how to remove an old management group with VB script

18/04/2014 Leave a comment

Recently I needed a quick solution to a problem during a migration project. the problem was that some agents point to more then 1 management group. I found 2 good starting point to my problem: Manipulating SCOM 2012 agent multihoming options by script & Remove a Management group from a SCOM 2012 agent with script by Bob Cornelissen. System Center 2012 Operations Manager includes an agent configuration library that we can use to add, remove or view management group information using a script. my goal was to add a task to the new Operations Manager installation that in the end will help the customer to remove old management groups whenever he need.

Option Explicit

Dim objMSConfig

Set objMSConfig = CreateObject(“AgentConfigManager.MgmtSvcCfg”)

‘Get all management groups and display the port

Dim collMG

Set collMG = objMSConfig.GetManagementGroups()

if collMG.count > 1 then

   wscript.echo “found ” & collMG.count & ” management groups”

   ‘Enumerate the collection

   Dim mgItem

   For Each mgItem In collMG

       if mgItem.ManagementGroupName <> “<YourMGName>” then

       Call objMSConfig.RemoveManagementGroup (CStr(mgItem.ManagementGroupName))

          wscript.echo CStr(mgItem.ManagementGroupName) & ” removed”

       end if


end if

‘ enumerate MG again for task info Set collMG = objMSConfig.GetManagementGroups()

For Each mgItem In collMG

    wscript.echo “found ” & collMG.count & ” management group: ” & mgItem.ManagementGroupName


Step taken:

  1. Create a blank MP
  2. Goto authoring pane and right click on tasks
  3. Select “run a script” under agent tasks and point to the blank MP from step 1.
  4. Give the task a name and target the task to “Agents”
  5. Enter the script name and paste the above script
  6. Click “create”
  7. Goto monitoring pane -> Operations Manager -> agent details -> agent health state
  8. Click an agent or multi select several agents and click on the task
  9. View the task log for success or failures.

link from MSDN:

Agent Configuration Library Overview – Provides an overview of agent configuration scripting.

How to Add and Remove a Management Group – Describes how to add and remove a management group.

How to Display Management Group Information – Describes how to display management group information.



Hope you will find it helpful.

Categories: OpsMgr, OpsMgr2012

Cool article by Marnix Wolf

04/10/2012 1 comment

A long time since my last post.

today I read the last post of Marnix and I must say that this is exactly the topics that interest me in our field. As always Marnix presents the subject in his unique way.


Wow! On my HP Elitebook notebook with an I7 Intel CPU, SSD HD and 16 GBs of RAM I run Windows 8 RTM version with Hyper-V enabled. On the SSD I run all my VMs which – guess what – run some System Center 2012 components like SCOrch and OpsMgr 2012.

On itself it’s already awesome: when I put my notebook into hibernation, the VMs will be set into a saved state, basically meaning when I start my notebook again, the VMs will run from the moment they were paused.

So my VMs are running for more then a few weeks now, without any glitch at all. All the screens which I had opened in all my VMs before hibernating my notebook, are found back in the exact same way after my notebook is on again. Even better, all processes which I started run from where they left off…

And that’s really something very good Microsoft pulled of here. So no more need for any other hyper-visors on my Windows 8 machine! Again, awesome! Respect. This feature on itself is for me enough to migrate ALL my pc’s to Windows 8!”


Categories: OpsMgr2012, Technology

2011 in review

01/01/2012 1 comment

The WordPress.com stats helper monkeys prepared a 2011 annual report for this blog.

Here’s an excerpt:

The concert hall at the Syndey Opera House holds 2,700 people. This blog was viewed about 17,000 times in 2011. If it were a concert at Sydney Opera House, it would take about 6 sold-out performances for that many people to see it.

Click here to see the complete report.

Categories: Uncategorized

New Job!!!

15/11/2011 2 comments

Hi all,

As you see I didn’t add any new posts for a long time.

I’ve joined Microsoft services at the beginning of October 2011 and I’m still learning my new position as a consultant. Winking smile

Hope to add more knowledge about System Center products later on.


Categories: Uncategorized

Operations Manager 2007–great article from the Support Team blog

18/09/2011 1 comment

Standard Dataset Maintenance troubleshooter for System Center Operations Manager 2007

“Standard Data Set Maintenance is a workflow that runs against the Data Warehouse to aggregate, optimize, and groom data. This workflow runs on the RMS and is triggered every 60 seconds. There is a hard-coded timeout for the workflow and under many circumstances can fail, resulting in 31552 events in the RMS Operations Manager event log.”


I had this problem in several sites before and I needed to gather information from many sources to resolve the issue.

J.C. Hornbeck did a great job as usual.

Categories: OpsMgr

Cloud Computing Vs. Virtualization – humorous advertising by Microsoft

01/09/2011 Leave a comment

the following advertising expresses (the competition?! Rolling on the floor laughing) the change in thinking in transit to cloud computing.
Is virtual computing is considered to be a cloud? Time will tell, but until then, enjoy …

Categories: Technology Tags:

EX2010 Management Pack – Guidance, Tuning and Known Issues

01/09/2011 Leave a comment

Microsoft released a KB article that intend to help us deal with best practice and known issues with the new management pack.

“This article is intended to give some best practice guidance along with workarounds to known issues involving the Exchange 2010 Management Pack (MP) running on System Center Operations Manager 2007 (SCOM). Please look through this document before calling for support or posting to the forums as the issue may be covered below. If you find that these issues are particularly troublesome or find additional issues that you want fixed please call into Microsoft Support and raise a Request For Hotfix with the Exchange group.”

For more information :http://support.microsoft.com/kb/2592561#phrss

Categories: OpsMgr Tags: