---
title: Scripting Maintenance Mode in SCOM 2012
description: Today, we wanted to share an easy way to script groups for maintenance mode. If you don’t want to manually run this, you can run it as a scheduled task.
image: http://info.adaptivedge.com/hubfs/Imported_Blog_Media/adaptivedge-scom-maintenance-mode.jpg
---

Call us Today! (866) 846-7123

[![AdaptivEdge](https://info.adaptivedge.com/hs-fs/hubfs/adaptivedge.png?width=249&height=50&name=adaptivedge.png "AdaptivEdge")](http://adaptivedge.com/)

- [Home](http://adaptivedge.com/)
- [About](http://adaptivedge.com/about/) 
    - [News & Events](http://adaptivedge.com/news-events/)
- [Expertise](http://adaptivedge.com/expertise/)
- [Solutions](http://adaptivedge.com/services/)
- [News & Events](http://adaptivedge.com/news-events/)
- [Blog](https://info.adaptivedge.com/blog)
- [Contact](http://adaptivedge.com/contact-us/)

# Scripting Maintenance Mode in SCOM 2012

 2016-02-16 17:04:16

Posted by [aeadmin](https://info.adaptivedge.com/blog/author/aeadmin) on Feb 16, 2016 9:04:16 AM

- [Tweet](https://twitter.com/share)

 

Hello fellow SCOM’ers. Today, we wanted to share with you all an easy way to script maintenance mode in SCOM 2012. If you don’t want to manually run this, you can run it as a scheduled task. We like to manage this manually by running the script ourselves, but to each their own. Happy scripting!

## **Syntax**

GroupMaintMode -ScomServer “<scomserver>” -GroupDisplayName “<groupname>” \`  
 -DurationInMin 10  -Reason “<reasonformaint” -Comment “<comment>”

 

#--------Begin Sample Script----------------

#\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

# Name: SCOM 2012 Maint Mode PS Script

#

#  Parameters:

#

# -ScomServer: contians SCOM server name

# -GroupDisplayName: contains display name of the target group

# -DurationInMin: contains integer of desired duration in minutes

# -Reason: values are UnplannedOther, PlannedHardwareInstallation,

#           PlannedHardwareMaintenance, UnplannedHardwareMaintenance,

#           UnplannedHardwareInstallation, PlannedOperatingSystemReconfiguration,

#           UnplannedOperatingSystemReconfiguration, PlannedApplicationMaintenance,

#           ApplicationInstallation, ApplicationUnresponsive, ApplicationUnstable,

#           SecurityIssue, LossOfNetworkConnectivity

# -Comment: optional parameter

#\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

 

Function GroupMaintMode

#($ScomServer, $GroupDisplayName, $DurationInMin, $Reason, $Comment)

(

\[Parameter(Mandatory=$true)\]\[string\]$ScomServer,

\[Parameter(Mandatory=$true)\]\[string\]$GroupDisplayName,

\[Parameter(Mandatory=$true)\]\[Int32\]$DurationInMin,

\[Parameter(Mandatory=$true)\]\[string\]$Reason,

\[Parameter(Mandatory=$false)\]\[string\]$Comment

){

 

Import-Module OperationsManager

New-SCOMManagementGroupConnection -ComputerName $ScomServer

 

ForEach ($Group in (Get-ScomGroup -DisplayName  $GroupDisplayName))

{

If ($group.InMaintenanceMode -eq $false)

{

$group.ScheduleMaintenanceMode(\[datetime\]::Now.touniversaltime(), \`

(\[datetime\]::Now).addminutes($DurationInMin).touniversaltime(), \`

 

"$Reason", "$Comment" , "Recursive")

}

}

 

}

**Written and composed by one of our Senior Microsoft System Center Architects, Jessica Ervin-Hang**

 Tags: [scom](https://info.adaptivedge.com/blog/tag/scom), [PowerShell](https://info.adaptivedge.com/blog/tag/powershell), [system center](https://info.adaptivedge.com/blog/tag/system-center)

[![Are You Secure? Score a FREE O365 Security Assessment.](https://hubspot-no-cache-na2-prod.s3.amazonaws.com/cta/default/3330897/39721f23-2ea5-4dd5-a004-45ed24f6e8b4.png)](https://hubspot-cta-redirect-na2-prod.s3.amazonaws.com/cta/redirect/3330897/39721f23-2ea5-4dd5-a004-45ed24f6e8b4)

### We're here to help!

We'd love to find out more about the projects and initiatives you're working on to exchange ideas and provide some high-level guidance where we can.  We love learning from others as well as sharing some of our experience and lessons learned.  [Let's talk!](http://adaptivedge.com/contact-us/)

### Subscribe to Email Updates

### Recent Posts

### Posts by Tag

- [SharePoint (73)](https://info.adaptivedge.com/blog/tag/sharepoint)
- [OneDrive (45)](https://info.adaptivedge.com/blog/tag/onedrive)
- [Microsoft Entra (43)](https://info.adaptivedge.com/blog/tag/microsoft-entra)
- [Microsoft (42)](https://info.adaptivedge.com/blog/tag/microsoft)
- [microsoft teams (42)](https://info.adaptivedge.com/blog/tag/microsoft-teams)
- [Office 2013 (41)](https://info.adaptivedge.com/blog/tag/office-2013)
- [bookings (41)](https://info.adaptivedge.com/blog/tag/bookings)
- [exchange (41)](https://info.adaptivedge.com/blog/tag/exchange)
- [outlook (41)](https://info.adaptivedge.com/blog/tag/outlook)
- [Purview (40)](https://info.adaptivedge.com/blog/tag/purview)
- [data loss prevention (40)](https://info.adaptivedge.com/blog/tag/data-loss-prevention)
- [DLP (39)](https://info.adaptivedge.com/blog/tag/dlp)
- [Technology (37)](https://info.adaptivedge.com/blog/tag/technology)
- [Office 365 (30)](https://info.adaptivedge.com/blog/tag/office-365)
- [adaptivedge (27)](https://info.adaptivedge.com/blog/tag/adaptivedge)
- [cybersecurity (23)](https://info.adaptivedge.com/blog/tag/cybersecurity)
- [microsoft gold partner (20)](https://info.adaptivedge.com/blog/tag/microsoft-gold-partner)
- [ATS (18)](https://info.adaptivedge.com/blog/tag/ats)
- [HRIS (18)](https://info.adaptivedge.com/blog/tag/hris)
- [Human Resources (18)](https://info.adaptivedge.com/blog/tag/human-resources)
- [Azure (16)](https://info.adaptivedge.com/blog/tag/azure)
- [Cloud (10)](https://info.adaptivedge.com/blog/tag/cloud)
- [security (8)](https://info.adaptivedge.com/blog/tag/security)
- [Enterprise (7)](https://info.adaptivedge.com/blog/tag/enterprise)
- [Private Cloud (7)](https://info.adaptivedge.com/blog/tag/private-cloud)
- [microsoft 365 (7)](https://info.adaptivedge.com/blog/tag/microsoft-365)
- [Governance (6)](https://info.adaptivedge.com/blog/tag/governance)
- [Onboarding (6)](https://info.adaptivedge.com/blog/tag/onboarding)
- [cyberattack (6)](https://info.adaptivedge.com/blog/tag/cyberattack)
- [system center (6)](https://info.adaptivedge.com/blog/tag/system-center)
- [IoT (5)](https://info.adaptivedge.com/blog/tag/iot)
- [Mobile HR (5)](https://info.adaptivedge.com/blog/tag/mobile-hr)
- [PowerShell (5)](https://info.adaptivedge.com/blog/tag/powershell)
- [microsoft azure (5)](https://info.adaptivedge.com/blog/tag/microsoft-azure)
- [Active Directory (4)](https://info.adaptivedge.com/blog/tag/active-directory)
- [Employee Engagement (4)](https://info.adaptivedge.com/blog/tag/employee-engagement)
- [Employee Satisfaction (4)](https://info.adaptivedge.com/blog/tag/employee-satisfaction)
- [O365 (4)](https://info.adaptivedge.com/blog/tag/o365)
- [Secure Score (4)](https://info.adaptivedge.com/blog/tag/secure-score)
- [Teams (4)](https://info.adaptivedge.com/blog/tag/teams)
- [privileged accounts (4)](https://info.adaptivedge.com/blog/tag/privileged-accounts)
- [Adaptive Edge (3)](https://info.adaptivedge.com/blog/tag/adaptive-edge)
- [Classification (3)](https://info.adaptivedge.com/blog/tag/classification)
- [Collaboration (3)](https://info.adaptivedge.com/blog/tag/collaboration)
- [Compliance (3)](https://info.adaptivedge.com/blog/tag/compliance)
- [Data (3)](https://info.adaptivedge.com/blog/tag/data)
- [Education (3)](https://info.adaptivedge.com/blog/tag/education)
- [IaaS (3)](https://info.adaptivedge.com/blog/tag/iaas)
- [Labels (3)](https://info.adaptivedge.com/blog/tag/labels)
- [Licensing (3)](https://info.adaptivedge.com/blog/tag/licensing)
- [PaaS (3)](https://info.adaptivedge.com/blog/tag/paas)
- [Remote Workforce (3)](https://info.adaptivedge.com/blog/tag/remote-workforce)
- [SCCM (3)](https://info.adaptivedge.com/blog/tag/sccm)
- [SQL (3)](https://info.adaptivedge.com/blog/tag/sql)
- [Search (3)](https://info.adaptivedge.com/blog/tag/search)
- [Storage (3)](https://info.adaptivedge.com/blog/tag/storage)
- [identity management (3)](https://info.adaptivedge.com/blog/tag/identity-management)
- [API (2)](https://info.adaptivedge.com/blog/tag/api)
- [Autmoation (2)](https://info.adaptivedge.com/blog/tag/autmoation)
- [Azure AD (2)](https://info.adaptivedge.com/blog/tag/azure-ad)
- [BI (2)](https://info.adaptivedge.com/blog/tag/bi)
- [E5 (2)](https://info.adaptivedge.com/blog/tag/e5)
- [GitHub (2)](https://info.adaptivedge.com/blog/tag/github)
- [Microsoft Dynamics (2)](https://info.adaptivedge.com/blog/tag/microsoft-dynamics)
- [Microsoft Graph (2)](https://info.adaptivedge.com/blog/tag/microsoft-graph)
- [PAWS (2)](https://info.adaptivedge.com/blog/tag/paws)
- [People Analytics (2)](https://info.adaptivedge.com/blog/tag/people-analytics)
- [Performance (2)](https://info.adaptivedge.com/blog/tag/performance)
- [Power BI (2)](https://info.adaptivedge.com/blog/tag/power-bi)
- [SKU (2)](https://info.adaptivedge.com/blog/tag/sku)
- [Safety (2)](https://info.adaptivedge.com/blog/tag/safety)
- [Server (2)](https://info.adaptivedge.com/blog/tag/server)
- [Windows Defender ATP (2)](https://info.adaptivedge.com/blog/tag/windows-defender-atp)
- [microsoft ignite (2)](https://info.adaptivedge.com/blog/tag/microsoft-ignite)
- [AI (1)](https://info.adaptivedge.com/blog/tag/ai)
- [AI & Copilot (1)](https://info.adaptivedge.com/blog/tag/ai-copilot)
- [Artificial Intelligence (1)](https://info.adaptivedge.com/blog/tag/artificial-intelligence)
- [Attack Surface (1)](https://info.adaptivedge.com/blog/tag/attack-surface)
- [BYOL (1)](https://info.adaptivedge.com/blog/tag/byol)
- [Backup & Recovery (1)](https://info.adaptivedge.com/blog/tag/backup-recovery)
- [Business (1)](https://info.adaptivedge.com/blog/tag/business)
- [Business Requirements (1)](https://info.adaptivedge.com/blog/tag/business-requirements)
- [CASB (1)](https://info.adaptivedge.com/blog/tag/casb)
- [CRM (1)](https://info.adaptivedge.com/blog/tag/crm)
- [Cloud Computing (1)](https://info.adaptivedge.com/blog/tag/cloud-computing)
- [Coexistence (1)](https://info.adaptivedge.com/blog/tag/coexistence)
- [Customer Relationship Management (1)](https://info.adaptivedge.com/blog/tag/customer-relationship-management)
- [DBaaS (1)](https://info.adaptivedge.com/blog/tag/dbaas)
- [DMZ (1)](https://info.adaptivedge.com/blog/tag/dmz)
- [Datacenter (1)](https://info.adaptivedge.com/blog/tag/datacenter)
- [ERP (1)](https://info.adaptivedge.com/blog/tag/erp)
- [Enterprise Visual Studio (1)](https://info.adaptivedge.com/blog/tag/enterprise-visual-studio)
- [Group Writeback (1)](https://info.adaptivedge.com/blog/tag/group-writeback)
- [HRSM (1)](https://info.adaptivedge.com/blog/tag/hrsm)
- [Hybrid (1)](https://info.adaptivedge.com/blog/tag/hybrid)
- [IT Administration (1)](https://info.adaptivedge.com/blog/tag/it-administration)
- [Infrastructure (1)](https://info.adaptivedge.com/blog/tag/infrastructure)
- [Intune (1)](https://info.adaptivedge.com/blog/tag/intune)
- [LAPS (1)](https://info.adaptivedge.com/blog/tag/laps)
- [Microsoft 365 Updates (1)](https://info.adaptivedge.com/blog/tag/microsoft-365-updates)
- [Millennials (1)](https://info.adaptivedge.com/blog/tag/millennials)
- [OMS (1)](https://info.adaptivedge.com/blog/tag/oms)
- [OSD (1)](https://info.adaptivedge.com/blog/tag/osd)
- [Offboarding (1)](https://info.adaptivedge.com/blog/tag/offboarding)
- [Office 365 Groups (1)](https://info.adaptivedge.com/blog/tag/office-365-groups)
- [PXE (1)](https://info.adaptivedge.com/blog/tag/pxe)
- [Payroll (1)](https://info.adaptivedge.com/blog/tag/payroll)
- [Performance Reviews (1)](https://info.adaptivedge.com/blog/tag/performance-reviews)
- [Recruiting (1)](https://info.adaptivedge.com/blog/tag/recruiting)
- [Requirements Gathering (1)](https://info.adaptivedge.com/blog/tag/requirements-gathering)
- [SUP (1)](https://info.adaptivedge.com/blog/tag/sup)
- [SaaS (1)](https://info.adaptivedge.com/blog/tag/saas)
- [Security & Compliance (1)](https://info.adaptivedge.com/blog/tag/security-compliance)
- [Servers (1)](https://info.adaptivedge.com/blog/tag/servers)
- [Skype (1)](https://info.adaptivedge.com/blog/tag/skype)
- [Succession Planning (1)](https://info.adaptivedge.com/blog/tag/succession-planning)
- [TEM (1)](https://info.adaptivedge.com/blog/tag/tem)
- [Training and Development (1)](https://info.adaptivedge.com/blog/tag/training-and-development)
- [Travel and Expense (1)](https://info.adaptivedge.com/blog/tag/travel-and-expense)
- [UEBA (1)](https://info.adaptivedge.com/blog/tag/ueba)
- [Unified Groups (1)](https://info.adaptivedge.com/blog/tag/unified-groups)
- [UserVoice (1)](https://info.adaptivedge.com/blog/tag/uservoice)
- [VM (1)](https://info.adaptivedge.com/blog/tag/vm)
- [Virtualization (1)](https://info.adaptivedge.com/blog/tag/virtualization)
- [Windows 10 (1)](https://info.adaptivedge.com/blog/tag/windows-10)
- [Workflow Automation (1)](https://info.adaptivedge.com/blog/tag/workflow-automation)
- [Zero Trust (1)](https://info.adaptivedge.com/blog/tag/zero-trust)
- [copilot studio (1)](https://info.adaptivedge.com/blog/tag/copilot-studio)
- [custom scripts (1)](https://info.adaptivedge.com/blog/tag/custom-scripts)
- [digital transformation (1)](https://info.adaptivedge.com/blog/tag/digital-transformation)
- [disk utilization (1)](https://info.adaptivedge.com/blog/tag/disk-utilization)
- [geotagging (1)](https://info.adaptivedge.com/blog/tag/geotagging)
- [identity (1)](https://info.adaptivedge.com/blog/tag/identity)
- [identity perimeter (1)](https://info.adaptivedge.com/blog/tag/identity-perimeter)
- [mobile workforces (1)](https://info.adaptivedge.com/blog/tag/mobile-workforces)
- [orchestrator (1)](https://info.adaptivedge.com/blog/tag/orchestrator)
- [phishing (1)](https://info.adaptivedge.com/blog/tag/phishing)
- [scom (1)](https://info.adaptivedge.com/blog/tag/scom)
- [sharing (1)](https://info.adaptivedge.com/blog/tag/sharing)
- [software update (1)](https://info.adaptivedge.com/blog/tag/software-update)
- [windows automation (1)](https://info.adaptivedge.com/blog/tag/windows-automation)
- [windows server (1)](https://info.adaptivedge.com/blog/tag/windows-server)
- [workgroup (1)](https://info.adaptivedge.com/blog/tag/workgroup)

see all

### OUR COMPANY

As a Microsoft Gold Partner, AdaptivEdge helps customers evaluate various product options from a financial perspective as well as from a business and technical perspective.

### LINKS

- [Home](http://adaptivedge.com/)
- [Company](http://adaptivedge.com/about/)
- [Expertise](http://adaptivedge.com/expertise/)
- [Services](http://adaptivedge.com/services/)
- [News & Events](http://adaptivedge.com/news-events/)
- [Blog](http://adaptivedge.com/blog/)
- [Contact](http://adaptivedge.com/contact-us/)

### Latest Posts

### SIGN-UP FOR OUR EMAIL LIST

Sign-up below for updates about AdaptivEdge today!

### Footer Newsletter

- <https://www.facebook.com/adaptivedge>
- <https://twitter.com/youradaptivedge>
- <https://www.linkedin.com/company/6432727>

Copyright © 2026. AdaptivEdge, LLC. All rights reserved. Designed by [Bound-by Marketing](http://www.boundbymarketing.com)

![](https://secure.perk0mean.com/167743.png)