Operations Manager 2012 Maintenance Mode


”How can I schedule maintenance mode in SCOM 2012?”

“How can I put a server in maintenance mode without using the Operations Console?”

These are fairly common questions from my costumers. A lot of tools was developed to Operations Manager 2007, but not for 2012, hence this blog.


SCOM Remote Maintenance Mode Scheduler 2.0 by Tim McFadden

I can’t take any credit for this one, as it was developed by Tim McFadden, but it is the best (only) scheduler I can find. Furthermore, it has an UI, which makes it far easier to put servers or group in maintenance mode.

The only cons in my opinion: you have to enter username, password, task server and management server each time you use the tool. Furthermore (is it might just be me) I cannot get it to work without writing something in the comment field.

When putting a server in maintenance mode, a scheduled task is created.

To be downloaded at: http://www.scom2k7.com/scom-remote-maintenance-mode-scheduler-20/


There are a lot of scripts on how to put a group in maintenance mode, find them here.

It is fairly easy making a Powershell script to put a server in maintenance mode. The only problem is that we don’t have a  –StartTime parameter, which means we can’t schedule maintenance mode from Powershell. I have written these scripts to put a single server in maintenance mode right away:

# Ask user for server name (FQDN)

$ServerName = ReadHost What is the name of the server? (FQDN)
$Instance = GetSCOMClassInstance $ServerName
# Ask user for number of minutes
$Minutes = ReadHost For how many minutes?
$Time = ((GetDate).AddMinutes($Minutes))
StartSCOMMaintenanceMode Instance $Instance EndTime $Time Reason “Other(Unplanned)Comment your comment

You simply have to insert a server name and the number of minutes you want the server to be in maintenance mode. You can run this from a Windows Powershell by putting Import-Module –Name OperationsManager in the first line.

If you want to use days instead of minutes, use the below:

# Ask user for server name (FQDN)

$ServerName = Read-Host “What is the name of the server? (FQDN)”
$Instance = Get-SCOMClassInstance $ServerName
# Ask user for number of days
$Days = Read-Host “For how many days?”
$Time = ((Get-Date).AddDays($Days))
Start-SCOMMaintenanceMode -Instance $Instance -EndTime $Time -Reason “Other(Unplanned)”-Comment “your comment”
Happy maintenance mode’ing!
By |2017-08-22T13:06:40+01:00February 7th, 2013|Operations Manager (SCOM)|9 Comments

About the Author:

Michael Skov
Yet another guy loving the System Center products. My primary focus is on Operations Manager, which i have worked with for some years now - still loving it.Certifications:Microsoft Certified Solution Expert Private Cloud (MCSE)Microsoft Certified Solutions Associate Windows Server 2008 (MCSA)Microsoft Certified Technology Specialist Windows Server 2008 R2, Server Virtualization


  1. Vikentij December 6, 2013 at 12:22 - Reply

    Hi Michael,

    Thank you for above scripts!
    Found one mistake. “-Reason” parameters isn’t specified correctly. Should be one of below:


    Specifies a reason for maintenance mode. The acceptable values for this parameter are:

    — PlannedOther
    — UnplannedOther
    — PlannedHardwareMaintenance
    — UnplannedHardwareMaintenance
    — PlannedHardwareInstallation
    — UnplannedHardwareInstallation
    — PlannedOperatingSystemReconfiguration
    — UnplannedOperatingSystemReconfiguration
    — PlannedApplicationMaintenance
    — ApplicationInstallation
    — ApplicationUnresponsive
    — ApplicationUnstable
    — SecurityIssue
    — LossOfNetworkConnectivity


    Best regards,

  2. Michael Skov December 16, 2013 at 12:54 - Reply

    Hi Vikentij

    Thanks for visiting and commenting.

    You are so very right about the reasons – thanks!


  3. Krishna February 18, 2014 at 19:10 - Reply


    I am using SCOM 2007 r2 in my environment. I am performing a daily task by placing the 20 services in maintenence mode in difference timings each. These services are created in windows service template monitor.

    Please help me how to automate by using powershell script.


  4. Michael Skov February 18, 2014 at 19:17 - Reply

    Hi Krishna
    Thanks for commenting my blog.
    It wouldn’t be a problem to create the script (besides time) – but – do you have System Center Orchestrator implemented? This might be a good alternative to this.
    Unless I can invoice you for the script I will have to do it when I have time.


  5. Faizan July 14, 2014 at 17:48 - Reply

    You should also put the health service and health service watcher of that server, otherwise, an alert will be triggered if the server is rebooted

  6. […] a PowerShell script (created after reading about something similar on the Coretech Blog, here) that takes machine names passed in as the first parameter, places all machine names in an array, […]

  7. jaffa October 5, 2014 at 12:08 - Reply

    Hi Michael,

    I am trying to know the environment of other client in the company, can you help me with the detailed questions to ask to get to know their environment

  8. Socko December 18, 2014 at 20:28 - Reply


    From a command window I call a powershell file from a batch file that can place a server into maintenance mode. It works just fine but sometimes the server may already be in maintenance mode and I can see with the dos window “The class instance is already in maintenance mode.” Is there a way within the powershell script to capture the message “The class instance is already in maintenance mode.” and write to a log file?


  9. Shiva March 16, 2015 at 17:54 - Reply

    Hi ,

    I would like to use start time as i need them to put in scheduling at my own choice. any way where i can do this?

Leave A Comment