Table of Contents Applies toIntroductionPrerequisitesVerifying the agent on the monitored computerImporting the PowerShell module for maintenance modeSetting the agent computer in maintenance modeVerifying the SCOM Management server that the agent went into maintenance modeSee Also
This guide applies to System Center Operations Manager 2016, 1801, 1807, 2019
In this guide I will show you how quick and easy it is done.
First of all we will simply verify that the monitored computer has the SCOM agent installed, before proceeding.
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.
Import-Module "C:\Program Files\Microsoft Monitoring Agent\Agent\MaintenanceMode.dll"
Get-Help Start-SCOMAgentMaintenanceMode -ShowWindow
PlannedOtherUnplannedOtherPlannedHardwareMaintenanceUnplannedHardwareMaintenancePlannedHardwareInstallationUnplannedHardwareInstallationPlannedOperatingSystemReconfigurationUnplannedOperatingSystemReconfigurationPlannedApplicationMaintenanceUnplannedApplicationMaintenanceApplicationInstallationApplicationUnresponsiveApplicationUnstableSecurityIssueLossOfNetworkConnectivity
PlannedOther
UnplannedOther
PlannedHardwareMaintenance
UnplannedHardwareMaintenance
PlannedHardwareInstallation
UnplannedHardwareInstallation
PlannedOperatingSystemReconfiguration
UnplannedOperatingSystemReconfiguration
PlannedApplicationMaintenance
UnplannedApplicationMaintenance
ApplicationInstallation
ApplicationUnresponsive
ApplicationUnstable
SecurityIssue
LossOfNetworkConnectivity
The syntax that we will use to start a maintenance mode request is
Start-SCOMAgentMaintenanceMode
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. Use the Windows Computer class instead of the Agent class as the target for the override.
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).
Start-SCOMAgentMaintenanceMode -Duration 60
Note: In SCOM 2019 the agent will not create a registry event, SCOM 2019 will look for an event in the Operations Manager event log instead.
We have now successfully created a maintenance mode request.
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.
There you go, this is how easy it is to start maintenance mode from an agent computer.