Error running Remove-DisabledMonitoringObject in System Center Operations Manager

I’ve been experimenting with SCOM for a project I’m doing.  One of the things that people frequently complain about in SCOM is that when you enable a management pack those monitors are enabled for EVERY SINGLE MACHINE it discovers. Annoying right? Well turns out you can work around this. Here’s what you have to do:

 

  1. Create a group under Authoring and assign it to a new Management Pack (DO NOT USE THE Default Management Pack.. you probably know this already though.)
  2. Go to object discoveries and override the rules you don’t want active for servers in your group.
  3. Add servers to your group.
  4. Open the Operations Powershell Console and run the command: Remove-DisabledMonitoringObject

What this does is tells SCOM not to discover these services/monitors on this group of servers.  Then we run the powershell command because it tells SCOM to remove the monitors for any objects that are now disabled because otherwise these servers were already discovered and are already being monitored.  

What’s great about this method is that later if you decide you want to monitor these servers for these rules afterall, you can just move them out of your group, they’ll get discovered and then monitored!

Where the error happens

If you’re like me, you probably enabled a bunch of rules and moved a bunch of machines into that group and then ran the command and then got an error message like:

Remove-DisabledMonitoringObject : Microsoft.EnterpriseManagement.Common.Discover
taFromRuleTargetedToDeletedMonitoringObjectException: Discovery data has been re
ved from a rule targeted at a non-existent monitoring object id.
MonitoringObjectId: 4387e24c-436a-4287-4e18-c2e72c1262a0
RuleId: 3e0afe54-5b47-96e7-1da0-fd6739c81623
   at Microsoft.EnterpriseManagement.DataAbstractionLayer.InstanceSpaceOperation
eleteDisabledDiscoverySources()
   at Microsoft.EnterpriseManagement.ManagementGroup.DeleteDisabledMonitoringObj
s()
   at Microsoft.EnterpriseManagement.OperationsManager.ClientShell.RemoveDisable
nitoringObjectCmdlet.ProcessRecord()
At line:1 char:32
+ Remove-DisabledMonitoringObject <<<<
    + CategoryInfo          : InvalidOperation: (Microsoft.Enter…ingObjectCmdl
   :RemoveDisabledMonitoringObjectCmdlet) [Remove-DisabledMonitoringObject], Dis
  overyDataFr…ObjectException
    + FullyQualifiedErrorId : ExecutionError,Microsoft.EnterpriseManagement.Oper
   ionsManager.ClientShell.RemoveDisabledMonitoringObjectCmdlet

It’s at this point you’re probably scratching your head wondering what the heck is wrong with your install? Well, don’t worry.. The problem is that you have too many items getting executed at the same time.  I’m not sure if it’s too many machines, too many rules or a combination thereof, but what I do know is that to get around this error you have two options:

  1. Reduce the number of machines you’re adding to your group and the command will execute without error.
  2. Just keep running it. It is doing what it’s supposed to do so just keep running it until you get no more errors after a run.

Anyway, I wasted a ton of time on this one so I hope this post helps someone else waste less time.

Leave a Reply