Enabling SCOM Maintenance Mode from a Monitored Computer

System Center Operations Manager 2016 (SCOM) came out with a feature that many have been waiting for, placing agents in maintenance mode from the agent itself.
In this guide I will show you how quick and easy it is done.



  • System Center Operations Manager 2016 or newer.
  • A computer with SCOM agent installed.

Verifying the agent on the monitored computer

First of all we will simply verify that the monitored computer has the SCOM agent installed, before proceeding.

  1. Let’s start by logging on the computer monitored by SCOM.
  2. Once we are logged on to the monitored computer, we will go to the control panel to verify the SCOM agent, go to Start and write “Control Panel” and then click on Control Panel.scom_agent_mm1.0
  3. The Control Panel should now have opened for us.scom_agent_mm1
  4. Once we are in the Control Panel, type “Monitoring” in the search field which can be found in the upper right corner, we should see the Microsoft Monitoring Agent in the search result, open it by clicking on it.scom_agent_mm2
  5. The Microsoft Monitoring Agent Properties window will open up and we will see our SCOM agent configuration.scom_agent_mm3
  6. If everything looks OK we will continue to the next step.

Importing the PowerShell module for maintenance mode

We will not go through how to import the SCOM maintenance mode PowerShell module.

In this guide, we will use my DPM server as a test subject.


  1. We will now open up a Windows Explorer and browse to the SCOM agent installation folder C:\Program Files\Microsoft Monitoring Agent\Agent\scom_agent_mm4
  2. The PowerShell module for the SCOM maintenance mode is called MaintenanceMode.dll, we will search for it in the SCOM agent installation folder by typing the exact name of the dll file.scom_agent_mm5.png
  3. The first search result should be the dll file we searched for, now that we made sure that it exists we can continue to import the module into PowerShell.
  4. Go to Start and search for “PowerShell”, right click on PowerShell and choose Run as administrator.scom_agent_mm141.png
  5. We should now have a PowerShell window open.scom_agent_mm15.png
  6. Now we will import the MaintenanceMode.dll PowerShell module by typing the following into our PowerShell window: Import-Module “C:\Program Files\Microsoft Monitoring Agent\Agent\MaintenanceMode.dll”scom_agent_mm80
  7. Hit Enter to import the module, once it’s done we should be able to start using the SCOM maintenance mode cmdlets.
  8. Once the importing of the module is successful we will use the Get-Help to see closer on the SCOM maintenance mode module commands, for this guide I will use the –ShowWindow switch to make it more clear.
  9. Type Get-Help Start-SCOMAgentMaintenanceMode -ShowWindow in our PowerShell window.scom_agent_mm11
  10. A Start-SCOMAgentMaintenanceMode Help window should appear on our screen.scom_agent_mm12.png
  11. The following list of reasons are acceptable by the cmdlet:
  12. In the help window we can see the syntax and all the parameters required to run the command to start maintenance mode on the monitored computer.

Setting the monitored computer in maintenance mode

The syntax that we will use to start a maintenance mode request is

Every SCOM agent has a Rule that runs a PowerShell script (ReadMaintenanceModeRegEntry.ps1) every 5 minutes to read the registry entries on the agent computers.

Note: The Agent Initiated Maintenance Mode Rule is disabled by default, you will have to create an override to enable it.

Once the SCOM management server has successfully read the registry entry, it will write an event to the Oparations Manager event log with the Event ID 2222 and it will put the agent computer in maintenance mode.

We will now perform a simple test to see what happens when we run the
Start-SCOMAgentMaintenanceMode PowerShell command.

In this test I will put the monitored computer in maintenance mode for a duration of 1 hour (60min).

  1. To start the maintenance mode request of an agent the only requirement needed is the duration of the maintenance mode period.
  2. Type the following command to start the maintenance mode request with a duration of 1 hour: Start-SCOMAgentMaintenanceMode -Duration 60 then hit Enter to run the command.scom_agent_mm131
  3. We will now be prompted if we want to continue with this operation.scom_agent_mm151
  4. Type Y for Yes and N for No, in our case we will go ahead and type Y.scom_agent_mm161
  5. Once the PowerShell command has run, it will write information to the Windows registry on the agent computer (HKLM:\Software\Microsoft\Microsoft Operations Manager\3.0\MaintenanceMode\Record)scom_agent_mm165.png
  6. If we try to run the Start-SCOMAgentMaintenanceMode again before the previous maintenance period is over we will get the following message:scom_agent_mm167
  7. Now that we have run the PowerShell command, we can confirm that the maintenance mode request is successful by opening the Event Viewer and look in the Applications and Services Log\Operations Manager event log for the event ID 2222.scom_agent_mm164.1

We have now successfully created a maintenance mode request.

Verifying the SCOM Management server that the agent went into maintenance mode

Lastly we will verify that our agent really went in maintenance mode for 1 hour (60min), we will check this on the SCOM management server.

  1. Logon to our SCOM management server.
  2. We will start by first checking the Operations Manager event log in the Event Viewer, for the Event ID 2223.
  3. Open the Event Viewer, expand the Applications and Services Log and select the Operations Manager event log.scom_agent_mm169scom_agent_mm163.1
  4. We can see that the SCOM management server has successfully put the agent computer, in our case in maintenance mode.
  5. Next we will also check the Operations Manager console in the Monitoring view if the agent computer really is in maintenance mode.
  6. Open the Operations Manager scom console.
  7. We should automatically start in the Monitoring pane, on the list of monitoring items on the left side go to Windows Computers and find our agent computer where we initialized the maintenance mode.scom_agent_mm162
  8. We can now see that the DPM server is successfully in maintenance mode.

There we go, this is how easy it is to start maintenance mode from an agent computer.

9 thoughts on “Enabling SCOM Maintenance Mode from a Monitored Computer”

    1. Hi, you could actually use sendKeys. Put this in your script file:

      [System.Windows.Forms.SendKeys]::SendWait(“Y” + [char]13)
      Start-SCOMAgentMaintenanceMode -Duration 30 -Reason PlannedOther -Comment “testing maintmode from agent”


  1. Hi – did the non-interactive question get answered here? I’m looking to do the same, but haven’t found a way. Looks like the link above has been deactivated. Thanks.


  2. Hi all, I’ve tried a lot of times (I use SCOM 1801) but nothing is written to the registry.
    Is there somethig I miss here ?


    1. Hi,

      Have you created an override and enabled the rule “Agent Initiated Maintenance Mode Rule” ?

      This rule will trigger a PowerShell script called “ReadMaintenanceModeRegEntry.ps1” which will read the registry every 5 minutes.

      This is indeed not a very reliable method, and this is why Microsoft have changed the method of reading events in the Windows event log instead of the registry in SCOM 2019.

      Best regards,


      1. Thanks, yes I did all the requested actions, but it never worked. Indeed on SCOM 1801 I doubt this ever worked. I am also trying to create myself a MP managing the Maintenance Mode triggered by an event in event log on the target machine, and then execute the action code on the MS, but in the end it seems a waste of time, as nothing works.
        It seems M$ blocked this by design. I have no other clue.


      2. Hi,

        It works, but not in a good way, and it’s often very slow, hence the reason why Microsoft changed entirely how this works in SCOM 2019.
        Earlier a rule existed which runs a script (ReadMaintenanceModeRegEntry.ps1) that reads the Registry for an entry, nowadays the rule checks the Windows event log instead which is much more reliable.

        PS: I would strongly suggest upgrading your SCOM environment as SCOM 1801 or 1807 is not supported anymore.

        Best regards,


Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s