Optimized Group Maintenance Mode PowerShell for OpsMgr: 2012 R2 Edition

Below is the latest sample of optimized group maintenance mode for System Center Operations Manager (SCOM), which leverages the .ScheduleMaintenanceMode function, which allows for the inclusion of a request for recursion….the implementation of the “this object and contained objects”. This minimizes SDK calls and processing overhead for large groups.

GroupMaintMode -ScomServer “mmsscom01” -GroupDisplayName “SQL Server 2008 Computers” -DurationInMin 10 -Reason “ApplicationInstallation” -Comment “Scheduled weekly maintenance”

#--------Begin Sample Script----------------
# Name: OpsMgr 2012 Group Maintenance Mode 
# Description: Puts Groups into Maintenance Mode 
# Authors: Pete Zerger and Matthew Long  
# Parameters:
# -ScomServer: mandatory parameter containing mgmt server name (Netbios or FQDN)
# -GroupDisplayName: mandatory parameter containing display name of the target group
# -DurationInMin: mandatory parameter containing integer of desired duration in minutes
# -Reason: mandatory parameter containing reason. Acceptable values are UnplannedOther, 
#           PlannedHardwareMaintenance, UnplannedHardwareMaintenance,

#           PlannedHardwareInstallation, 
#           UnplannedHardwareInstallation, PlannedOperatingSystemReconfiguration, 
#           UnplannedOperatingSystemReconfiguration, PlannedApplicationMaintenance, 
#           ApplicationInstallation, ApplicationUnresponsive, ApplicationUnstable, 
#           SecurityIssue, LossOfNetworkConnectivity
# -Comment: optional parameter with free text description of your choice

Function GroupMaintMode 
#($ScomServer, $GroupDisplayName, $DurationInMin, $Reason, $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")


#Usage (calling the GroupMaintMode function)
GroupMaintMode -ScomServer "mmsscom01" -GroupDisplayName "SQL Server 2008 Computers" `
-DurationInMin 10  -Reason "ApplicationInstallation" -Comment "Scheduled weekly maintenance"

#--------End Sample Script----------------

#Usage (calling the GroupMaintMode function)
GroupMaintMode -ScomServer "mmsscom01" -GroupDisplayName "SQL Server 2008 Computers" `
-DurationInMin 10  -Reason "ApplicationInstallation" -Comment "Scheduled weekly maintenance"

#--------End Sample Script----------------

Questions or comments? Use the comments section below.

OpsMgr Overrides Report: 2012 R2 Edition

The following is latest tweak of my custom Overrides Report for System Center Operations Manager 2012 R2:

# ==============================================================================================
# NAME: OpsMgr Overrides Report
# ORGINAL AUTHOR: Daniele Muscetta and Pete Zerger
# ORGINAL DATE : 8/24/2010
# EDITED BY: Arjan Vroege
# EDITED DATA : 1/24/2014
# COMMENT: This report will output the overrides in your OpsMgr environment including
# override settings, target, source rule/monitor and source management pack.
# ==============================================================================================
#---Save the following text as script "Export-Overrides.ps1"

[Parameter(Mandatory=$true)] [string]$MS,
[Parameter(Mandatory=$true)] [string]$MP_Name,
[Parameter(Mandatory=$true)] [string]$output

#Connect to SCOM Environment
Import-Module OperationsManager
New-SCOMManagementGroupConnection -ComputerName $MS

#define the path you want to export the CSV files to
$exportpath = ""
$MPRpt = $null
$MPRows = $null

#gets all UNSEALED MAnagement PAcks
$mps = Get-SCOMManagementpack | where {$_.DisplayName -eq $MP_Name}

#loops thru them
foreach ($mp in $mps) {
$mpname = $mp.name
Write-Host "Exporting Overrides info for Management Pack: $mpname"

#array to hold all overrides for this MP
$MPRows = @()

#Gets the actual override objects
$overrides = $mp.GetOverrides()

#loops thru those overrides in order to extract information from them
foreach ($override in $overrides) {
#Prepares an object to hold the result
$obj = new-object System.Management.Automation.PSObject

#clear up variables from previous cycles.
$overrideName = $null
$overrideProperty = $null
$overrideValue = $null
$overrideContext = $null
$overrideContextInstance = $null
$overrideRuleMonitor = $null

#give proper values to variables for this cycle. this is what we can then output.
$name = $mp.name
$overrideName = $override.Name
$overrideProperty = $override.Property
$overrideValue = $override.Value

trap { $overrideContext = ""; continue } $overrideContext = $override.Context.GetElement().DisplayName
trap { $overrideContextInstance = ""; continue } $overrideContextInstance = (Get-SCOMClassInstance -Id $override.ContextInstance).DisplayName

if ($override.Monitor -ne $null) {
$overrideRuleMonitor = $override.Monitor.GetElement().DisplayName
} elseif ($override.Discovery -ne $null) {
$overrideRuleMonitor = $override.Discovery.GetElement().DisplayName
} else {
$overrideRuleMonitor = $override.Rule.GetElement().DisplayName

#fills the current object with those properties

#$obj = $obj | add-member -membertype NoteProperty -name overrideName -value $overrideName -passthru
$obj = $obj | add-member -membertype NoteProperty -name overrideProperty -value $overrideProperty -passthru
$obj = $obj | add-member -membertype NoteProperty -name overrideValue -value $overrideValue -passthru
$obj = $obj | add-member -membertype NoteProperty -name overrideContext -value $overrideContext -passthru
$obj = $obj | add-member -membertype NoteProperty -name overrideContextInstance -value $overrideContextInstance -passthru
$obj = $obj | add-member -membertype NoteProperty -name overrideRuleMonitor -value $overrideRuleMonitor -passthru
$obj = $obj | add-member -membertype NoteProperty -name MPName -value $name -passthru
$obj = $obj | add-member -membertype NoteProperty -name overrideName -value $overrideName -passthru

#adds this current override to the array
$MPRows = $MPRows + $obj

#Store up the overrides for all packs to a single variable
$MPRpt = $MPRpt + $MPRows

if($output -eq "csv") {
#exports cumulative list of overrides to a single CSV
$filename = $exportpath + "overrides" + $mp.name +".csv"
$MPRpt | Export-CSV -path $filename -notypeinfo
} elseif ($output -eq "html") {
$filename = $exportpath + "overrides" + $mp.name +".htm"
$MPRpt | ConvertTo-Html | Out-File $filename

Questions or comments? Use the comments section below.

Free E-book: Inside the Microsoft Operations Management Suite

Tao (@MrTaoYang), Stan (@StanZhelyazkov), Anders (http://contoso.se)  and I have been working on a project for the last few weeks. We wanted to bring a learning resource for the MS Operations Management Suite to the community that is complete, comprehensive, concise…and free (as in beer). While we finish final editing passes over the next couple of weeks, we wanted to share an early copy of the book so you can start digging in while we finish our work!

Description: This preview release of “Inside the Microsoft Operations Management Suite” is an end-to-end deep dive into the full range of Microsoft OMS features and functionality, complete with downloadable sample scripts (on Github). The chapter list in this edition is shown below:

  • Chapter 1: Introduction and Onboarding
  • Chapter 2: Searching and Presenting OMS Data
  • Chapter 3: Alert Management
  • Chapter 4: Configuration Assessment and Change Tracking
  • Chapter 5: Working with Performance Data
  • Chapter 6: Process Automation and Desired State Configuration
  • Chapter 7: Backup and Disaster Recovery
  • Chapter 8: Security Configuration and Event Analysis
  • Chapter 9: Analyzing Network Data
  • Chapter 10: Accessing OMS Data Programmatically
  • Chapter 11: Custom MP Authoring
  • Chapter 12: Cross Platform Management and Automation

This early edition is being shared with the community while final edits are being completed. Please send questions, comments or errata you find to insidemscloud@outlook.com.

You can download for free from the TechNet Gallery at:


SCOM Health Check Reports v3 on GITHUB

Oskar and I recently collaborated to update the SCOM Health Check Reports we wrote so long ago for Operations Manager 2012 R2 (SCOM).

We have posted the managment pack and guide on the Microsoft TechNet Gallery at https://gallery.technet.microsoft.com/SCOM-Health-Check-Reports-c32e8f93.

We have posted the source code on GITHUB in a repository as well. The GIT repository is located at https://github.com/pzerger/scomhealthcheck.

I’ll post a separate article with tips on how to get the most from the SCOM Health Check Reports in the next few days!

Inside System Center 3: Best Free System Center Solutions – Show Notes

In this episode, Dan and Pete talk about some of the more robust free solutions for System Center 2012 R2, including a couple of gems you have not seen before! Links to all the resources discussed (and some we didn’t get to) below!

New Show Updates

To get updates on the latest episodes of Inside System Center and Inside the Microsoft Cloud, follow on twitter (@insidemscloud@insidepodcast) or like us on Facebook at http://facebook.com/insidepodcastnetwork.

Episode Links

Audio editionavailable shortly!

Video edition – https://www.youtube.com/watch?v=tKfoJ-hBv0Y

OpsMgr 2012 R2

While there are thousands of great articles and scripts and related solutions for OpsMgr, here are a few of the more function-rich freebies. A couple of lesson known solutions in here! 

NiCE Log File Monitoring MP



MP Author (Silect Software)

OpsMgr Self Maintenance Management Pack (by Tao Yang)


PKI Certificate Verification MP (by Raphael Burri)


Effective Configuration Viewer (Stefan Roth)


Adding GUI Authoring Support for PowerShell Monitors in OpsMgr (Wei H Lim)


ConFigMgr 2012 R2

While most everyone is familiar with the right click tools, we discussed a couple of other (and in some cases newer)  free solutions.





PowerShell Inventory Script (David O’Brien)


Kent Agerland’s List of Community Tools


Service Manager 2012 R2

Here are a few of our favorites for SCSM.

SCSM Dashboards (by Signature Consultancy)


SCSM Entity Explorer


Free Community Stream (from Cireson Software)


SCOM DPM Dashboard




Automating Software License Reclamation with System Center 2012 SCCM + Orchestrator

Part 1 – Software Metering Deep Dive and Automation Part 1: Use It Or Lose It – The Basics

This installment has a quick overview of the software metering feature in case you’re not familiar.

Part 2 – Software Metering Deep Dive and Automation Part 2: Use It Or Lose It – The Collections

This installment includes the collections of those systems using an application, and another collection with systems where the application is not being used.

Part 3 – Software Metering Deep Dive and Automation Part 3: Use It Or Lose It – The Orchestrator Runbook Automation

Sample Runbooks – Automation Use Cases



Orchestrator Sample Runbooks: Core Examples, PowerShell Examples, and Scenario E



Inside System Center #2: OpsMgr Dashboarding – Show Notes

In this episode, we had a panel to discuss the host of dashboarding options for System Center 2012 R2 Operations Manager. This is a video podcast, so be sure to check out the demos of each vendor presented in this episode! 

Watch the episode at https://youtu.be/NuMAUKEDkx0


Resources related to Savision courtesy of Cameron Fuller (@CFullerMVP)

Savision whitepaper: “Is OpsMgr Still relevant in the Cloud?:: https://www.savision.com/free-whitepaper-mvp-cameron-fuller-tackling-elephant-room-opsmgr-still-relevant-cloud
Blog post series on OpsMgr and mobile: “Taking my OpsMgr with me”: http://blogs.catapultsystems.com/cfuller/archive/2014/04/11/taking-my-opsmgr-with-me-wrap-up/
Blog post on the new Dashboards product: “Kicking the tires”: http://blogs.catapultsystems.com/cfuller/archive/2015/04/09/kicking-the-tires-on-the-new-dashboards-by-savision-product-1/
Savision whitepaper: “The Road to the Cloud”: https://www.savision.com/resources/white-paper/road-cloud-mvp-cameron-fuller-0 (not specifically mentioned but relevant to the conversation)

Squared Up

Resource links for Squared Up, courtesy of Tao Yang (@MrTaoYang)
Squared Up Perf Data:

Visio Dashboard for existing DA:

Collecting Data to OMS example (I think I mentioned it in the beginning):

Also, the Visio maps I used in the demo today can be downloaded for free from here:

Opslogix (ProView)

Resource links for Opslogix ProView, courtesy of Pete Zerger (@pzerger)

ProView homepage – http://www.opslogix.com/proview/

Getting Started Videos

Keep an eye out for new episodes of the Inside System Center podcast twice a month on the Inside Podcast Networks website at http://ipn.tv.