OpsMgr 2012 Self Maintenance Management Pack

This blog has been a bit quiet lately because of 2 reasons: FIFA World Cup and I’ve been updating the OpsMgr 2012 Self Maintenance MP. 🙂

What’s new in version

  • Corrected spelling mistake in Management Server maintenance mode watcher display name
  • Updated knowledge article for OpsMgr 2012 Self Maintenance Detect Manually Closed Monitor Alerts Rule
  • Additional Monitor: OpsMgr 2012 Self Maintenance Management Server Default Action Account OpsMgr Admin Privilege Monitor
  • Additional Monitor: OpsMgr 2012 Self Maintenance Management Server Default Action Account Local Admin Privilege Monitor
  • Additional Rule: OpsMgr 2012 Self Maintenance Obsolete Management Pack Alias Detection Rule
  • Additional Agent Task: Get Workflow Name(ID)
  • Additional Agent Task: Reset Monitor Health State
  • Additional Agent Task: Remove Obsolete MP References

Additional Monitors to check if management servers action account has local admin on management servers and OpsMgr privileges

I often get emails from people who are having issues configuring workflows in the Self Maintenance MP. I found one of a common issues is that the default action account for management servers does not required privileges. Therefore I created 2 monitors in this release to monitor if the MS action account has local administrator and OpsMgr administrator privileges.



Additional Rule: OpsMgr 2012 Self Maintenance Obsolete Management Pack Alias Detection Rule

As I mentioned in my previous post PowerShell Script: Remove Obsolete References from Unsealed OpsMgr Management Packs, I’ve created a rule that detects obsolete MP references in unsealed management packs. The difference between the stand alone script (from previous post) and this rule is, this rule would only detect obsolete MP references, it will not try to remove them. Operators can use the “Remove Obsolete MP References” agent task manually remove them (or using the standalone script I published earlier).


Additional Agent Task: Remove Obsolete MP References

This task targets All Management Servers Resource Pool and can be used in conjunction with the Obsolete Management Pack Alias Detection Rule to delete obsolete MP references from unsealed management packs.


Additional Agent Tasks: “Get Workflow Name(ID)” and “Reset Monitor Health State”


Previously, few people have suggested me to provide a method to reset all instances of a particular monitor. Recently, Cameron Fuller showed me a script from Matthew Dowst’s blog post and suggested me to add this into the Self Maintenance MP.

The script from Matthew’s blog resets health state of all instances of monitors with a given display name. In my opinion, this is not granular enough as there are monitors sharing same display name, we can not use display name to uniquely identify a particular monitor.



Therefore, when I was writing the script for the Reset Monitor Health State agent task, I used monitor name instead of display name. However, since the monitor name is actually not viewable in the Operations Console, I had to create another agent task to get the name of a workflow (monitors, rules and discoveries).

i.e. let’s use the “Computer Browser Service Health” monitors as an example.

Get the monitor(s) using SCOM PowerShell Module:


In my environment, there are 2 monitors that have the same display name. the actual monitor name is highlighted in the red rectangles. the names are unique. It is actually the MP element ID in the management pack where the monitor is coming from:


So in order to use the “Reset Monitor Health State” task, operators firstly need to identify the monitor name (MP element ID), then paste it into an override field of the task. To make it easier, we can use the “Get Workflow Name(ID)” agent task to get the name:


Then copy and paste the monitor name into the “MonitorName” override parameter of the “Reset Monitor Health State”:




Where to find the detailed information for these additional items?

I have only covered a very high level overview of these additional workflows in this post. the detailed information can be found in the updated MP documentation (From Section 5.2.24 to 5.2.29):


Please make sure you read each section before enabling / using each workflow!


I’d like to thank Cameron Fuller, Bob Cornelissen and Raphael Burri for the suggestions and testing effort. Also, thanks Matthew Dowst for the original scripts in his posts.

Lastly, if you have suggestions or issues / questions that are not documented in the documentation, please feel free to contact me.



  1. Hi Tao. Great as always. I have one issue which with task “Get DW Retention”: when I run it, it returns: cmd : Value must be supplied for parameter -s At line:1 char:1
    + cmd /c ‘C:\Program Files\Microsoft System Center 2012 R2\Operations Manager\Serv …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    I check and the dwdatarp.exe is in the right place.

    1. Hi Yaniv,

      Could you email me the full error message with a screenshot? I just tried in my lab and I can run it OK. btw, are you using version 2.4 of the MP?


  2. Hi yes Im using the latest version 2.4. This is the full error:

    Get DW Retention
    Task Description

    Status: Success
    Scheduled Time: 08/07/2014 16:29:32
    Start Time: 08/07/2014 16:29:32
    Submitted By:
    Run As:
    Run Location:
    Target Type: Management Server
    Category: Operations

    Task Output:

    DW Database Server:
    DW Database Name:
    dwdatarp.exe location: C:\Program Files\Microsoft System Center 2012 R2\Operations Manager\Server\Health Service State\Resources\1837\dwdatarp.exe

    DW Retention Setting:
    cmd : Value must be supplied for parameter -s
    At line:1 char:1
    + cmd /c ‘C:\Program Files\Microsoft System Center 2012 R2\Operations Manager\S
    erv …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (Value must be supplied for parame
    ter -s:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

    Value must be supplied for parameter -d

    Microsoft Operations Manager Data Warehouse Data Retention Policy Utility v6.0.

    -s Data Warehouse SQL server name
    -d Database name
    -ds Dataset name
    -a Aggregation name
    -v Verbose output (in comma-delimited format)
    -m Days to keep data (integer, > 0)

    dwdatarp -s server -d database [-ds dataset [-a aggregation]] [-v]
    dwdatarp -s server -d database -ds dataset -a aggregation -m days

    To display Event dataset data retention information with verbose output
    dwdatarp -s opsmgrdwsrv -d OperationsManagerDW -ds Event -v

    To set performance dataset hourly aggregations to hold 60 days of data
    dwdatarp -s opsmgrdwsrv -d OperationsManagerDW -ds Performance -a Hourly -m 6


  3. When you state “The OpsMgr 2012 version only works on OpsMgr 2012.” are you lumping OpsMgr 2012 R2 into it as well or do you specifically mean only OpsMgr 2012?

  4. First of all thank you very much for this great management pack! However, I do have an issue while I try to enable the OpsMgr 2012 Self Maintenance Balance Agents Within Resource Pool rule. The error I get is:

    Note: The following information was gathered when the operation was attempted. The information may appear cryptic but provides context for the error. The application will continue to run.

    : Verification failed with 1 errors:
    Error 1:
    Found error in 2|OpsMgr.2012.Self.Maintenance.Overrides||OpsMgr.2012.Self.Maintenance.Overrides|| with message:
    XSD verification failed for the management pack. [Line: 0, Position: 0]
    System.Xml.Schema.XmlSchemaValidationException: The ‘Alias’ attribute is invalid – The value ‘2012’ is invalid according to its datatype ‘ManagementPackUniqueIdentifier’ – Name cannot begin with the ‘2’ character, hexadecimal value 0x32. —> System.Xml.XmlException: Name cannot begin with the ‘2’ character, hexadecimal value 0x32.
    — End of inner exception stack trace —
    at System.Xml.Schema.XmlSchemaValidator.SendValidationEvent(XmlSchemaValidationException e, XmlSeverityType severity)
    at System.Xml.Schema.XmlSchemaValidator.CheckAttributeValue(Object value, SchemaAttDef attdef)
    at System.Xml.Schema.XmlSchemaValidator.ValidateAttribute(String lName, String ns, XmlValueGetter attributeValueGetter, String attributeStringValue, XmlSchemaInfo schemaInfo)
    at System.Xml.XsdValidatingReader.ValidateAttributes()
    at System.Xml.XsdValidatingReader.ProcessElementEvent()
    at System.Xml.XsdValidatingReader.Read()
    at Microsoft.EnterpriseManagement.Configuration.XSDVerification.ValidateManagementPack(TextReader mpcontents, ManagementPack mp, Boolean throwError)

    : XSD verification failed for the management pack. [Line: 0, Position: 0]

    Did I miss something or is it something else?

  5. Is this just on my infrastructure or is there a bug in OpsMgr.2012.Self.Maintenance.Collect.All.Management.Server.SDK.Connection.Count.Rule?
    I get a timeout for script SDKConnectionProbe.ps1. I tried extending the timeout period from 120s to 240s, but still it times out.
    My All Management Servers Resource Pool contains 2 Management Servers.

    That rule actually does more or less the same as the Get Currently Connected Users to the MS task, right? If I run that task it only takes a second to show me the result.

    1. the task and the rule serve different purpose. the rule collects total SDK connection count as perf data whereas the task shows who’s connected at the point of time. the rule works on all the environments that I have implemented the MP. Can you confirm the MS action account has local admin rights on all MS?

      1. Yep, the Action Account is member of the local Administrators group or our Management Servers.

        When I change the task credentials from ‘predefined’ to ‘other’ and enter the Action Account’s credentials, the task also runs fine btw…

        I meant: to get the data the rule and task will do more or less the same thing, no? I know the rule will store the info as perfdata in the DB, while the task will simply show the result and not keep it. But to retrieve that info, both are very similar I guess?

  6. Hi Tao,
    Congratulations on your new company. I know it’s late to wish, but then better be late than never.

    I just wanted to check with you on this MP(v2.4.0.0), I was trying to import this MP in MpStudio(for version control) and I got a strange error.
    Value cannot be null. Parameter name: key
    It seems something trivial is missing(my guess).

  7. Thanks for another great MP. Unfortunately, I cannot get the “OpsMgr 2012 Self Maintenance Enable Agent Proxy Rule” to do anything. It’s enabled via override, but it never will enable proxy on my agents. I dug into the MP and got the script out to try to run it manually. I found that it was looking for the “DefaultSDKServiceMachineName” entry in the registry. I have the entry, but it is blank. I populated the entry with a management server name, but then the script just sets the agent array to a list of blank names (i.e. it recognizes that there are 13 agents with proxy disabled, but it doesn’t actually list the names–$arrAgentNames returns 13 blanks) and then the value of $Agent is null, so the whole thing fails.

    What am I missing?

Leave a Reply

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

%d bloggers like this: