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…
- Use SCOM web console – Well yes, but isn’t it a bit complicated / “kind of a long way”?
- Use SCOM console – I hope you don’t have it installed everywhere on your servers.
- Use PowerShell – Better choice, but do you have PowerShell on all your servers deployed? What about Windows Server 2003 SP2?
- 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.
- 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.
- Calling the SCOM operator – Well, not the best choice :).
- 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).
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…
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…
After you clicked Set, the name is written into the current users registry…
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…
Copy all files in one folder and start the tool…
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!
I am happy to hear your feedback!
23 Replies to “SCOM 2012 – Maintenance Mode Tool V 1.0”
Very nice sir!
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?
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.
Great tool! Quick question. Is there a way to get the Start Maintenance Mode field to not be grayed out?
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.
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!
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.
Check my latest post about the console version. This app you would be able to schedule.
That would be great. Thanks!
can we put multiple servers in maintenance mode using this tool?
Not yet, but I also got other feature requests, which I am thinking to build into this tool.
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?
Ja klar wäre so etwas möglich. Danke für den tip, werde dies versuchen demnächst einzubauen.
Cool. Danke schon mal im voraus 😉
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)?
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 :).
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”
Ich kann über das GUI wegen dem 12-Stunden Format keinen Endtermin für 12:01h – 23.59h setzen.
Ok, danke werde es anschauen.
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?
The download link is invalid now. Can you post another link to download the tool ?