Start SCOM Maintenance Mode with PowerShell

By | 2017-12-13

Turns on Maintenance Mode for a specific computer monitored by SCOM (System Center Operations Manager).  Ensure that the OperationsManager module is available on the computer from which this script is executed.

Example script puts machine into maintenance mode for 15 minutes (adjustable by changing the $time variable).  At the time specified, the machine will come out of maintenance mode automatically.

Import-Module OperationsManager
$computer = "mycomputer.mydomain.com"
$time = (Get-date).AddMinutes(15)
$instance = Get-SCOMClassInstance -Name $computer -ComputerName myscommgmtserver
Start-SCOMMaintenanceMode -Instance $instance -EndTime $time -Comment "Applying updates" -Reason PlannedOther

Author: dwirch

Derek Wirch is a seasoned IT professional with an impressive career dating back to 1986. He brings a wealth of knowledge and hands-on experience that is invaluable to those embarking on their journey in the tech industry.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.