Disabling all Discoveries in a SCOM 2012/2016 Management Pack

I’m not completely sure that I’ve ever needed to disable all discoveries in an MP…(some of them yes)…In most cases if I want none of the discoveries then I may as well just delete the MP. But since I was emailed the question, yes absolutely…like with my recent Rules and Monitors posts you can use that same code to disable Discoveries. Let’s get to it!

So again we’ll to follow the same steps…

Step 1…Create a blank unsealed MP to store the overrides in. Once you’ve created your Overrides MP, just note down the name.




















Step 2…Change lines 1 and 2 to the names of the MP you wish to disable the Monitors in and the overrides MP you wish to save the overrides to.

Step 3…Run the script!

# Disable all Disoveries in a Sealed MP to an Unsealed Overrides MP

$mp = Get-SCOMManagementPack | ? {$_.Name -eq “Microsoft.SQLServer.2012.Monitoring“}
$overridesmp = Get-SCOMManagementPack | ? {$_.Name -eq “Microsoft.SQLServer.Monitoring.Overrides“}
$Discoveries = Get-SCOMDiscovery -ManagementPack $mp
Disable-SCOMDiscovery -Discovery $Discoveries -ManagementPack $overridesmp

Depending on the number of Discoveries in this Management Pack you can expect this to take a few minutes…

Leave a Reply

Your email address will not be published.