Management Pack Software

SCOM 2012 – UPDATE: SCOM Task Collection MP

A few weeks ago I started with a Task Collection MP found on this post. As I am getting new ideas I will add more tasks to make life easier. In the latest version SCOM Task Collection MP version I added 3 more tasks…


First here brief overview of the current tasks which were found in version

01) Turn Firewall On
This task will turn on the windows firewall .

02) Turn Firewall Off
Well, it explains itself. The task will turn off the windows firewall for all profiles.

03) Get Logged On User
If you need to know who is currently logged on console and RDP sessions then you will run this task. It shows you also if the session is active or disconnected.

04) Get Computer Uptime
This task shows you the last boot time and the uptime of the computer.

05) Get Local Admins
This tasks shows you the users which are in the local administrators group on the respective computer.

06) Get Free Disk Space
Sometimes you need to know quickly the free disk space of the logical disks and also its disk sizes.

07) Get Pending Reboot
This task will check if there is a pending reboot for the computer.

08) Set Dirty Bit
This is an old “thing”, but I had a couple of times the need for running check disk at boot time. This task will set the dirty bit on drive C:, so that the server will run check disk the next time it starts.

09) Get DNS Settings
This task shows you the configured DNS server settings and the server’s IP address.

10) Fix Support Tool Path
If you try to execute Active Directory related tasks from the Active Directory management pack like DCDiag, Repadmin etc. they will not work because the path to these tools has changed on Windows 2008 (R2) domain controllers. I have written a blog post about it. This task will create the necessary symbolic link as written here to get it working.

New are task 11, 12 and 13:

11) Remove Management Group from Agent
If you have multi-homed agents which report to two management groups your agent will have two management group settings. This scenario is very likely in a SCOM side-by-side migration where you have the SCOM 2012 agent reporting to SCOM 2007 R2 AND SCOM 2012. If you need to remove one of the management group settings from the agent you can execute this task. You just need to provide the management group name (click the Override button and type the management group name) which you want to remove from the agent in the format:



12) Add Management Group to Agent
If you need to add another management group setting to an agent you can execute this task. Just select a managed Windows computer in SCOM, run this task and click the Override button. You need to provide 3 parameters:

  • Management group name
  • SCOM management server
  • Port (usually port 5723)

The values need to be in the format:



13) Mark Windows Server in Registry
This task is able to write 2 registry values into two predefined registry keys. First, this tasks creates a key in HKLM\SOFTWARE\SpecialKeys . Within this key two additional keys are generated one is called Category and one is called Team. Now you can add values to Category and Team if you run this task click Override and provide the values in the following format:


This would write PRODUCTION into the Category key and SQL into the Team key, the task looks like this…


…and the result like this…


Well, you think now cool and so what? My intension is to have a quick way to set registry values to which will be discovered by attributes in SCOM. These attributes which discover the Category and Team key could be used to build dynamic groups based on the respective value in SCOM.

Now what do you think, huh Smiley?

If you want to delete the registry values (not the keys!) just execute the task as it is without modifying anything.

If you are new or not familiar with dynamic groups and attributes Kevin Holman wrote some time ago a blog post.

I added just 3 more tasks but I think they will be very useful and there is more to come. You can download the SCOM Task Collection MP here from skydrive.

18 Replies to “SCOM 2012 – UPDATE: SCOM Task Collection MP

  1. nice, i have similar, i call it scom.stupid.admin.tricks. mostly similar, some more specific to our needs, had a task library in tivoli doing the same thing, people don’t understand if you have an agent on the machine you own the machine, consider modifying group memeberships and see what your audit people think 🙂

    1. Hi

      Thank you.

      You are right, but as always with great power comes great responsibility. You have to be careful who has access to which tasks, I would be very restrictive in giving access to tasks in general.



  2. Is there a way to use this in opsmgr2007R2? Error when importing:
    This management pack cannot be imported.
    : XSD verification failed for management pack. [Line: 1, Position: 40]
    The ‘SchemaVersion’ attribute is not declared.

    1. Hi,

      No this MP is written for SCOM 2012 only. As the MP schema for SCOM 2012 is not compatible with SCOM 2007, it will not work. I would have to create a MP for 2007 which would also work in SCOM 2012.



  3. Hi I am trying to import in SCOM 2012. Even then I am getting an error.
    “The dependencies for this management pack cannot be located.”

  4. Yes would be very nice. Also could you limit the free disk task results to Local Disk (drivetype=3) disk. Now I see system reserved disks etc.

  5. Hi, when using the ‘remove MG from agent’ don’t you have to restart the health service too? If not then this is great for me! Cheers

      1. Thanks for the reply Stefan. I only ask because after I ran it the agent came back into pending management. I couldnt see the 103 event in the OM event log either. I’ll try a couple more though. Perhaps its a config thing.
        Cheers Pete

  6. sorry for a delay 🙂
    when we add new management group to agent, it is not used immediatelly.
    we need to restart the service, if we want the new managemt group being used by agent.

  7. Hello Stefan, I cannot download this MP as the link is not working. I am particularly after Uptime task. May you please send me the correct link. Thank you 🙂

  8. I try to modify the task for 13) of the scripts and create new agent task that suit our need but it showing errors.

    The Event Policy for the process started at 2:41:11 PM has detected errors in the output. The ‘StdErr’ policy expression:

    matched the following output:

    C:Program FilesSystem Center 2012Operations ManagerServerHealth Service StateMonitoring Host Temporary Files 58538199SetRegistryKeys.vbs(1, 24) Microsoft VBScript compilation error: Expected end of statement

    Command executed: “C:Windowssystem32cscript.exe” /nologo “SetRegistryKeys.vbs” “MY-KLDC” “CP2”

    Working Directory: C:Program FilesSystem Center 2012Operations ManagerServerHealth Service StateMonitoring Host Temporary Files 58538199

    One or more workflows were affected by this.

    Workflow name: ConsoleTaskGeneratedByUI79063720d76d4eab9acbdc74945765a0

    Instance name: XXX

    Instance ID: {2EE5C6AF-9370-E069-A347-9835106CF1AD}

    Management group: XXX

    Error Code: -2130771918 (Unknown error (0x80ff0032)).

    What it could be wrong

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.