OpsMgr: Modified Brian’s Scheduled Maintenance Mode MP

Together with my colleague Marek Kuzminski, we have slightly modified Brian's scheduled maintenance mode MP (Scheduling Groups of Objects for Maintenance Mode) to add following features:

  • Override by group display name

  • Add additional rules to allow 10 different maintenance schedules

  • Add a run as profile to the MP to facilitate permissions to schedule maintenance mode

  • Added simple error handling in maintenance mode script for troubleshooting

I wasn't able to re-use that MP to do different schedules just by overrides. So the design is still rather 'quick', and limits your number of schedules to 10 (number of rules). To use overrides for different schedules and computer groups bound to the same rule, the MP would have to be redesigned.

Thx to Brian for posting his great MP, and Marek for his help.


Comments (14)

  1. Anonymous says:

    Andrzej Lipka, a fellow consultant in Poland, took my maintenance mode sample MP and added some interesting

  2. Anonymous says:

    We had some great discussion last night at the Denver Enterprise Management User Group, where I spoke

  3. daviesg says:

    Technically very interesting but doesn’t hide the fact that 18 months after release OpsMgr doesn’t have a supported way of setting scheduled maintenance from a GUI.

    For a systems management tool, this is exceptionally poor. What is the lack of design thinking behind this?

  4. Yes, I can only agree with you. Being a consultant in the field, I don’t have much influence on the product group doing design and development. All I can do is report that many customers are missing this simple, yet very needed feature.

  5. WillKaiser says:

    Deffinately a desirable expansion on the features.

    I just imported this MP into a test environment and was unable to get it working.  I tested Brian’s original MP successfully, might there be something simple I’m missing?

    The steps I followed upon import:

    – Verified the discovery of ‘Proxy Command Shell’

    – Populated ‘MCS Scheduled Maintenance Mode Group 1’ with several agents

    – Enabled the rule for group 1

    – Created an override for the group pointing it to the proper group name (default group name and name in the rule were different) and updated the time.

    No luck.  Any thoughts?

  6. Did you create a RunAs Windows account that maps to a SCOM admin account, and added that to this runas profile?

    "MCS Scheduled Maintenance Mode RunAs SCOM Admin"

    You need to do that in order to perform the run the scheduled maintenance mode script under an account that has sufficient permission (default action account won’t have it usually).


  7. WillKaiser says:

    Yes, I added an action account that is both a SCOM administrator and a local admin on all agent servers to no avail.

    I did however only specify the RMS in the RunAs profile, should all agents to be managed with this MP be specified?

    Thanks, the help is appreciated.

  8. Will,

    You probably did not set the overrides right. you need to do this this way:

    1. Operations Managera 2007 console -> Authoring.

    2. Management Pack Objects, Rules.

    3. Find MCS Scheduled Maintenance – group x rule

    4. Right click on the rule and choose: Overrides > Override the Rule > For a specific object of type: Command Shell Proxy

    5. Choose your RMS here

    6. in Override Properties do your configurations.

    7. confirm changes (OK).

    Let me know if thats how you did this. If yes, and it still fails, check the opsmgr event log on RMS for any errors on processing that rule.

  9. And additionally remember in point 6 to point to a group name (by its DISPLAY NAME!!). the rest of params is as in Brian’s script. This way all objects in that group will be put to maintenance mode. It should work not only for groups, but I have tested it only on groups.


  10. WillKaiser says:

    Originally I had created my override pointed to ‘All objects of type: Command shell proxy’.  I went back and deleted that override and created a new one targetted to ‘Specify object of type: Command Shell Proxy’, and I then specified the RMS.

    I’m still having no luck.  The effective values in my override match those in Brian’s screenshot, with the addition of the group name (which I copied and pasted from the properties of the group itself):

    Parameter name -> Effective value

    Enabled -> True

    DayOfTheWeek -> 127

    StartTime -> 12:15

    HoursInMaintenance -> 1

    GroupName -> MCS Scheduled Maintenance Mode Group 1

    Description -> Scheduled nightly maintenance mode

    IncludeHostedObject -> $false

    The rule is enabled.  Runas account is configured & pointed to RMS.  The ‘Command shell proxy’ discover is showing up in the monitoring tab.

    I checked the Operations event log on the RMS, I didn’t see any errors or warning referencing the rule.

    It’s got to be something simple that I’m missing…

  11. Will,

    Ping me at alipka at microsoft dot com offline

    I have the whole procedure for using this MP, but its in Polish:(

    I think this is not right:

    IncludeHostedObject -> $false

    if you set maintenance mode on the group, but don’t include hosted objects you won’t see much.

    Try changing this to $true.

    Is the command shell proxy object discovered?


  12. WillKaiser says:

    I sent you an email.

    I tested again with the IncludeHostedObject option set to ‘$true’.  No luck.

  13. brent.flesner says:

    MCS Scheduled Maintenance MP does not allow you to select clustered RMS server in the override for a specific object of type: Command Shell Proxy.   It works fine for environments with non-clustered RMS server.  I tried choosing the RMS Computer Group but it does not work.   Has anyone else made this work where the RMS server is clustered?

Skip to main content