In this post, I’ll walk you through a PowerShell script I created to quickly disable all rules and monitors from a source SCOM Management Pack, saving the overrides in a separate target Management Pack. I developed this script to address an issue I encountered while working with the „Security Monitoring“ Management Pack.

 

The Use Case

I needed to monitor Security Group membership changes, which the „Security Monitoring“ Management Pack covers well. However, when I imported it, I noticed that all its workflows—discoveries, rules, and monitors—were enabled by default. This setup generated a lot of alerts, many of which were redundant for my environment, creating noise rather than actionable insights. To reduce this noise, I decided to disable all rules and monitors from this Management Pack.

Initially, I remembered seeing a community script that accomplished this task, but after searching for it and coming up empty, I decided to create my own. The result is a script that not only meets my needs but is also simple and efficient to use.

 

Script Overview

The PowerShell script retrieves all rules and monitors from a source Management Pack and disables them by creating overrides in a target Management Pack. Each rule and monitor is disabled for its respective target class, so you can apply this script to specific scenarios without affecting other SCOM settings.

 

Requirements

  • Operations Manager PowerShell Module: Ensure that this module is loaded in your PowerShell session.
  • Source and Target Management Packs: Specify the source Management Pack from which you want to disable rules and monitors, and create a target Management Pack to store these overrides.

 

Script Usage

  1. Pre-create the Target Management Pack: Before running the script, create an empty Management Pack in SCOM where you’ll store the overrides.
  2. Specify Management Pack Names: Update the $SourceMP and $TargetMP variables with the display names of the source and target Management Packs.
  3. Run the Script: Once the display names are set, you’re ready to run the script. It will disable all rules and monitors from the source Management Pack and store the overrides in the specified target Management Pack.

 

Script Breakdown

Below is the PowerShell script. The script does the following:

  • Loads the Operations Manager module (if not already loaded).
  • Retrieves the source and target Management Packs.
  • Fetches all rules and monitors from the source Management Pack.
  • Disables each rule and monitor by creating overrides in the target Management Pack for their target classes.

 

Key Points to Note

  • Error Handling: The script includes error handling for cases when the Management Packs or SCOM classes cannot be retrieved, which ensures the script exits gracefully with informative messages.
  • Targeted Class Overrides: Each rule or monitor is disabled specifically for the class it targets, allowing for precise control over which workflows are affected.
  • Enforce Parameter: Using the -Enforce parameter ensures the overrides are applied immediately, minimizing delay in effect.

 

Download Location

https://github.com/StoyanChalakov/SCOM.CreateOverridesInBulk

 

Conclusion

This PowerShell script provides a quick solution to disable all workflows within a SCOM Management Pack in bulk. With just a few setup steps, you can easily apply it to any Management Pack and adjust the overrides to suit your monitoring needs.