OpsMgr Self Maintenance Management Pack


I had this idea to automate some repetitive maintenance tasks that every SCOM administrator perform regularly via a management pack. So I started to write a OpsMgr self maintenance MP during my spare time around July last year, right after my baby girl Rosie was born. since then, I’ve got side-tracked many times, i.e. left for TechEd in September for a week, studying for ConfigMgr 2012 exam, studying for the 3 Windows Server 2012 MCSA exams, writing other management packs such as the Weather monitoring MP, etc. This MP has been sitting there 90% completed for months.

Few of weeks ago, I passed all 3 Windows Server 2012 exams required for MCSA, and got a phone call from my friend Dan Kregor. Dan told me he wanted to write a maintenance MP for OpsMgr, and I told him I’ve got one 90% done. So we got together, went through what needed to be included and Dan gave me some good ideas. Over last few weeks, I have spent most of my spare time working on this MP. Initially this MP was only designed for 2007 (which would also work on 2012), I then decided to build a 2012 version (based on OpsMgr 2012 MP schema) so the MP can utilise resource pools. There are also few additional rules / monitors in the 2012 version. Anyways, I’ve now finally finished both version of the MP. Below paragraphs are ripped from the MP documentation:


OpsMgr Self Maintenance Management Pack automates some routine tasks generally performed by OpsMgr administrators on a regular basis. It also provides few rules / monitors to monitor the OpsMgr management group itself. This management pack contains 2 version.

  • The OpsMgr 2007 R2 version works on both 2007 R2 and 2012 versions of OpsMgr.
  • The OpsMgr 2012 version only works on OpsMgr 2012.

The 2012 version of this management pack is able to utilize OpsMgr 2012 resource pools and also provides additional rules and monitors than the 2007 version. For OpsMgr 2012 environments, it’s strongly recommended to use the 2012 version of this management pack.

The following workflows are included in this management pack:

  • Automatically balance OpsMgr agents among a group of management servers.
  • Automatically close aged rule-generated alerts
  • Convert all manually installed OpsMgr agents to Remote-Manageable.
  • Enable Agent-Proxy for all agents
  • Backup Unsealed (and Sealed) management packs.
  • Remove Disabled discovery objects
  • Detect staled stage change events
  • Monitoring the size of LocalizedText able from the OpsMgr operational database.
  • Detects OpsMgr management servers in maintenance mode (Only available in OpsMgr 2012 version of the MP)
  • Performance Collection rule for total number of SDK connection within the management group (among all management servers). (Only available in OpsMgr 2012 version of the MP).
  • Agent tasks for:
    • Manually backup management packs
    • Get currently connected users to the SDK service
    • Enable Agent Proxy for all agents.

All the rules and monitors from the OpsMgr Self Maintenance management packs are disabled by default. This is to ensure OpsMgr administrators only turn on the workflows that are required for the OpsMgr environments they support and configure the required parameters for workflows to suit the environment.

The agent tasks from the management packs are enabled by default.

An unsealed override management pack is provided for each version of the OpsMgr Self Maintenance MP. OpsMgr administrators can use provided unsealed override MP for customization or they can also create their own override MPs for this purpose.


I’d like to thank Dan Kregor for sharing ideas with me and taking time testing the MP.

I appreciate any feedback from the community, this is only the first release, any thoughts on additional workflows that I can build into this MP is much appreciated!

Both versions of the management packs and the documentation can be downloaded HERE.


  1. Please note this MP has been updated to address an issue with the LocalizedText DB table monitor. the attachment has been updated in this post. for those who has already downloaded the MP, please download again. the 2012 version of the MP is now version (2007 version unchanged).

    1. i am a basic user on SCOM, please tell me how i can deploy this MP, i already installed in SCOM still not sure what to do now,

  2. Hi, I can’t understarnd why the atsks, even if enabled by default, are not visible in my monitoring pane. Also It’s not possible to enable the monitor “LocalizedText Table Health Monitor”. Am I missing something

    1. Which version are you using? for 2007 version, if you create a state view for RMS, or use “Discovered Inventory” view and choose RMS, should be able to see the task in the task pane. for 2012 version, choose “All management servers resource pool” and “management server” depending which tasks you are after.

  3. Thank’s for MP, very usefull for me. One feature request/suggestion:
    Automatically recalculate monitors with closed alerts

  4. Hey there. Amazing toolset that I so want to implement. Sadly, I’m feeling like the rookie of the day when trying to create overrides on the rules in the MP. So is there an forum or the like where one can share config issues etc etc? (getting an long xml error – “System.Xml.Schema.XmlSchemaValidationException: The ‘Alias’ attribute is invalid – The value ‘2012’ is invalid according to its datatype ‘ManagementPackUniqueIdentifier'”)

  5. I used my own created MP to store the overrides. But reading your comment I seems I should use the provided one… Will try that now… or? 🙂

  6. Have you considered adding a Scheduled Maintenance mode automatic rule/task? Something that can be targeted to a group of servers on a schedule. We do this through powershell today and Task Scheduler but this would simplify things greatly.

  7. I got error when trying to implement override on the monitor:

    Error 1:
    Found error in 2|ManagementServersResourcePool||ManagementServersResourcePool|| 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]

      1. Hello,

        I have imported your Opsmgr 2012 self maintenance MP however i could see only one rule with related to this MP . Does it work on 2012 SP1 UR2 environment?

        1. Definitely works for SP1. I have it running at my lab, which is SP1 UR1 at the moment. I’m not sure what you mean by you could only see one rule? which rule did you see?

          1. After Imported the Opsmgr 2012 Version Management pack. i could see only below rule

            Opsmgr2012 Self maintenance legacy balance agents rule

    1. David, the MP is the correct one. The legacy balance agents rule is targeting RMS (RMSE in 2012), others are targeting All Management Servers resource pool. please make sure you’ve scoped to the correct target.

      1. So, i have to import Opsmgr 2007 Management pack too in scom 2012 Sp1 environment.. since Opsmgr 2012 has only one rule??

        1. You don’t have to import the 2007 version of the MP. Let me reiterate, all the rules are in the 2012 MP. You can see them using MPViewer. Please do not keep making false statements.

  8. Hi there.

    This looks really great, however we use a standard naming convention for our Override MPs, therefore why can’t we just create a new MP instead of using your one?
    Creating a new one gives me the same errors mentioned above when trying to do an override.


  9. Steve,

    If you don’t want to use the one provided, you’ll need to do the following:
    1. export the override MP
    2. remove the reference to the self maintenance MP if exists (in {manifest} {references} section, which is located at the top of the xml).
    3. add the following lines inside the {references} tag:

    {Reference Alias=”OM12SelfMaint”}
    Please replace { and } with angle brackets. WordPress doesn’t like me to use these tags…
    If I remembered correctly, problem is that SCOM doesn’t like the phrase “2012” as part of the reference alias.

    1. Thanks – the above workaround worked fine (re using our own Override MP).
      Great job, thanks very much!

  10. Thanks Tao Yang for you MP! I am trying to get the backup working on it I get the following error(s):

    OpsMgr 2012 Self Maintenance Management Packs Backup Failed on
    Errors from Backup Script:

    Errors from the Management Packs backup script:

    BackupError No management packs are found in management group.
    Result failed

    Please can you point me in the right directon to resolve this. Thanks for your help, very much appreciated.

    1. Hi – did you resolve the “No management packs are found in management group.” error? I get the exact same error. I have the latest version installed and have enabled backup of both unsealed and sealed MP’s

      1. It was a permissions issue the default action account did not have rights. I added to the administrator profile and it resolved the issue

  11. Jamie,
    What if you use the backup MP agent task that is targeting the All Management Servers Resource Pool? Do you get the same result?

    1. Hi Tao, thanks for your prompt response. If I run the Backup MP agent task manually it works perfectly. Any ideas on why scheduled task is not working? Same error every time ” No management packs are found in management group.”

      1. just had a look the script again, this particular error is logged when you choose not to backup sealed MP and there’s no unsealed MPs found. I’m not sure why are you getting this error. what happens if you choose to backup sealed MPs? Could you email me your override MP please?

  12. Hi again Tao

    Has this been tested on SCOM 2012 RTM and SP1? The reason I ask is that we have this running in 3 environments, 2 RTM and 1 SP1.

    In both RTM environments, the Management Servers in Maintenance Mode Monitor which triggers the PowerShell script “MgmtServerInMaintModeProbe.ps1” appears to crash one of the monitoringhost.exe’s very frequently throughout the day (2-3 times an hour), but doesn’t against the SP1 environment. This has occured for weeks and we have been pulling our hair out trying to resolve it, then yesterday I noticed about 20 seconds prior to every single crash, a successful 9705 event is logged regarding this PS script.

    Researching the crashes lead me to this link which indicated PowerShell script probes: http://www.systemcentercentral.com/forums-archive/topic/opsmgr-2012-rtm-agent-crashes-anybody/

    I have disabled this monitor and both RTM environments are stable again.


    1. Hi Steve, I only tested this on SP1 management group. I don’t have any RTM management groups that I can test. have you applied the latest RTM Update Rollup in these management groups?

      1. Hi Tao, no we are a bit behind in rolling any updates actually. We will try to get SP1 in one of the two environments by the end of next week, so will re enable the monitor following the upgrade and post the outcome. Thanks Tao


  13. Hi! great MP, I have SCOM 2007 recently updated to CU7, and the rules are not working for me, the MP backup created the folder but no backup inside and the closed aged rule is not working for me either. Any ideas?

          1. If the MP backup failed, the MP backup rule should generate an alert with the error message. Did you get that particular alert related to MP backup failures?

          2. Other than the permission issue, I can’t think of anything else. there is also an agent task for MP backups. are you able to successfully run that task? if you can, it’s most definitely permission issue.

          3. when I run it manually it finishes successfully, with the action account but gives this message:

            Backup Management PacksTask Description

            Status:SuccessBackup Management Packs
            Scheduled Time:4/24/2014 10:30:13 AM
            Start Time:4/24/2014 10:32:07 AM
            Submitted By:xx
            Run As:
            Run Location:
            Target Type:Root Management Server
            Task Output:

            Management Packs backup completed successful!
            The term ‘Try’ is not recognized as a cmdlet, function, operable program, or sc
            ript file. Verify the term and try again.
            At line:67 char:6
            + Try <<<< {
            The term 'Try' is not recognized as a cmdlet, function, operable program, or sc
            ript file. Verify the term and try again.
            At line:79 char:5
            + Try <<<< {

            Several times, I cut it because there were too many lines with the same haha.

          4. does your action account have local admin rights on your management servers? btw, what OS do you have running on your management servers?

          5. if it has local admin rights on the management servers as well as a member of SCOM administrators role. I’m not sure why wouldn’t it work. I’ve never tested my MP on Windows 2003.

Leave a Reply to Steve Cancel reply

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

%d bloggers like this: