Configuration Recommended Software Tool

SCOM 2012 – Maintenance Mode Tool V 1.0

From my customers and also in the forums I hear and read frequently the questions about setting maintenance mode from a monitored server. Let’s assume you are an administrator and you need to put your file server in maintenance mode. How are you going to set maintenance mode? Well there are many ways, let’s just summarize a few…

  1. Use SCOM web console – Well yes, but isn’t it a bit complicated / “kind of a long way”?
  2. Use SCOM console –  I hope you don’t have it installed everywhere on your servers.
  3. Use PowerShell – Better choice, but do you have PowerShell on all your servers deployed? What about Windows Server 2003 SP2?
  4. Write a Windows event which will be detected by SCOM and the objects are put via script in maintenance mode – Yes, good choice, but I don’t have quite a feedback from SCOM if the server really is in maintenance mode or not.
  5. Use Orchestrator – Always a good choice, but how are you going to trigger the Runbook, by PowerShell? Same problem as in 3.. Use Orchestrator web console? Same problem as in 1.
  6. Calling the SCOM operator – Well, not the best choice :).
  7. Getting some maintenance mode tool – Yes, now we are on the right track, buddy, but the tools I know of are all for older SCOM versions like 2007 (R2).
  8. etc…

I am sure there are many more other options, therefore I wanted to have this problem solved and make a tool which hopefully solves all these problems and works for SCOM 2012 and later.

The best way I figured out, is using the SDK from SCOM. This Software Development Kit (SDK) allows you to write code in e.g. C# to extend and utilize the functionality of SCOM. As I would like to learn a bit more C# and more about SCOM SDK this small project is just perfect. Microsoft delivers you some example which gives you a head start. As for example for putting objects in maintenance mode you can find an example here. I used the latest SDK functionality for SCOM 2012 which should work with all versions of SCOM 2012.

So how does it look like? Well, does not look that bad…

image

The design might look familiar to you, as I have taken the basic layout from Ryan Andorfer because I would have done it the same way. Good job Ryan!

So how does it work? Well, I think it is pretty much self explaining. As the program starts, it loads the computer name on which the tool is running. If you run it for the first time, you need to set your management server to which you would like to connect in the settings tab…

image

After you clicked Set, the name is written into the current users registry…

image

The rest works a you would expect it to work.

If you would like to run the program, you need of course the MMTool.exe and in addition in the same directory the 3 SDK binaries which are usually located in the SDK Binaries folder…

image

Copy all files in one folder and start the tool…

image

I have tested it on several systems BUT there might be a certain setup which could cause a problem. If so, let me know.

Run this tool on your own risk! I am not responsible for any damage or any other problems this tool causes! Try it out in your lab first!

Download the version 1.0 here 

I am happy to hear your feedback!

23 Replies to “SCOM 2012 – Maintenance Mode Tool V 1.0

  1. Just to make sure I understand the scope, this is only to but a single managed system into Maintenance Mode, not the entire Operations Manager site?

    1. Hi

      Yes, it will a put a single system into maintenance mode. Either a Windows computer or Unix/Linux computer which is managed. It is the same as you would put a system in the Windows Computers or UNIX/Linux Computers state view into MM. The classes I use are Windows Computer and UNIX/Linux Computer.

      Let me know how it works and goes.

      Cheers,

      Stefan

  2. Hello,

    Great tool! Quick question. Is there a way to get the Start Maintenance Mode field to not be grayed out?

    Thanks!

    1. Hi

      Thank you. The reason this field is greyed out is, that you cannot set a start date in the future. It is always the current date/time. Therefore I have to make sure you cannot change it so I disabled the control.

      Cheers,

      Stefan

      1. Thanks for the quick reply Stefan.

        Is there a reason why you cant schedule Maint Mode in the future? I would like to give my people this option for our monthly patch cycles.

        Thanks again for your reply. Again, great little app!

        -Vic

        1. Hi

          Well, as you can see in the SCOM console there is also no way to “schedule” maintenance mode. You would need some sort of scheduler which is not built-in neither in SCOM nor in this tool. I will provide a possibility soon. Stay tuned.

          Regards,

          Stefan

  3. Hallo,

    Sehr schönes Tool. Ich würde dies gerne auf diversen Servern einsetzten und dazu per SCCM direkt auf den Desktop Verteilen so das es für jeden Admin sofort zu starten ist. Allerdings wäre es dazu einfacher (da nicht alles lokalen Admins den SCOM Servernamen kennen) wenn ich das Tool z.b. über einen Parameter starten könnten damit der SCOM Server Name direkt übergeben wird (oder diesen aus der Config Datein auslesen).

    ist sowas möglich/geplant?

    Gruß

  4. Hallo Stefan,
    Dein Tool sieht echt super aus. Funktioniert es denn auch mit der aktuellsten SCOM Version 2012 R2?
    Startparameter wie bei dem Kollegen wären natürlich super, als auch dass beim Start gleich der lokale Server mit herangezogen wird. Denn oft möchte ich ja direkt diesen Server in Wartung setzen.

    Gibt es denn von Deiner Seite aus die Überlegung eine Gruppe in MM zu setzen (oder vielleicht auch durch einlesen aus einer Textdatei)?

    Grüße

    1. Hallo Uwe

      Ja es funktioniert mit der neusten Version von SCOM. Danke für deine Ideen, ich möchte es einmal erweitern sobald ich etwas Zeit habe. Jetzt kommt die Winterzeit und dann werde ich weitere Features einbauen :).

      Beste Grüsse

      Stefan

  5. I am getting this error against a SCOM 2012 R2 U3 installation
    “Maintenance mode could not be set. please check your class or computer selection”

  6. Hallo Stefan
    Ich kann über das GUI wegen dem 12-Stunden Format keinen Endtermin für 12:01h – 23.59h setzen.
    Viele Grüsse
    Mike

  7. How can you specify AM vs. PM when setting the stop time for the maintenance window? It appears that 4 = 4 PM, but how do you set the stop time to 4 AM tomorrow for example?

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.