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 Comments

    • 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

  1. Pingback: OpsMan » SCOM 2012 – Maintenance Mode Tool V 1.0

  2. 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ß

  3. 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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s