Before I dive into the mechanics of removing discovered inventory, I want to attempt a quick definition of this cmdlet and it’s intended use.

An object (MonitoringObject) is an instance of a class (MonitoringClass). So, if an object is removed (Remove-DisabledMonitoringObject) from discovered inventory, monitoring defined for (targeting) that class will not be delivered to that object.  Because, as far as that MonitoringClass is concerned, that MonitoringObject does not exist.

A couple reasons why this cmdlet is useful.

1.  It enables us to quickly remove discovered objects, in order to remove these instances from being included in workflows from a MP, instead of going through a mountain of rules and monitors and creating disable overrides.

2.  It enables us to cleanup discovered objects.  For example – we create a group of agents to include in AD Client Monitoring after the ADMP is imported.  Down the road, it is decided that we don’t want some of those agents to participate in AD Client Monitoring.  So we remove a few agents from the group, but the discovered objects remain…hence, the AD Client Monitoring workflow is still delivered to that agent.  We need to run the cmdlet to finish the job.  A little more about this at the end.

For this example, I will be removing AD Client Monitoring objects.  This example assumes you have ADMP imported with some agents enabled for AD Client Monitoring.  However, the steps are the same for any kind of inventory you wish to remove.

First, open up the console and take a look at the Monitoring pane > Discovered Inventory.  In the Action pane, click Change target type.  Select Active Directory Client Perspective.



As you can see, I have 8 agents enabled for Client Perspective.  In this example, I’d like to remove 3 of these objects.

01 - Discovered Inventory 1


What I need to do here, is go into the Authoring pane > Object Discoveries.  Scope to Active Directory Client Perspective.  As you see, the discovery is targeting Windows Computer.  This is what we need to target to remove the discovered objects.

02 - Object Discovery for AD Client Perspective


Now, we could go ahead and disable override for specific agents.  But, if you have more than a handful, you might consider creating a group.  Either way, we’re going to need to target Windows Computer in order for this to work.


I’m creating a group, targeting Windows Computer, and adding my 3 explicit members.

03 - Create group targeting Windows Computer class


After our group is created, let’s go back to Authoring > Object Discoveries.  Override the discovery for a group.  In the override, select the Enable parameter and change to False.  Remember to save to your MP (not default MP).

04 - Override for group


Now, open Operations Manager Command Shell and run



There is no indication in the cmdlet that anything really happened.  But, if you go back to the Monitoring pane > Discovered Inventory, you’ll notice that the inventory has disappeared.  This is fairly instantaneous.  If your inventory is still there, go to step one 🙂

05 - Discovered Inventory 1


A little tip on removing discovered objects for optional discovery rules.  Let’s say…AD Client Monitoring!  As we know, this discovery is not enabled by default.  We create a group and apply an enable override to it, in order to get AD Client Monitoring to the agent.  One might think that in order remove AD Client Monitoring from a couple agents down the road, we may just remove those couple of agents from the group and run the Remove-DisabledMonitoringObject cmdlet.  Because the discovery is not enabled by default…right?

Unfortunately, that’s not the case.  I’ll explain why. 

Remove-DisabledMonitoringObject will only remove inventory that has already been discovered, for objects that have an override for Enable = FALSE explicitly for the discovery rule. In this case, an object has been discovered by enabling the discovery rule for it by setting override Enable = TRUE. If you were to remove the override for that object, it would go back to its default setting…which is “not configured”. In essence, it “tattoos” the setting. In order for Remove-DisabledMonitoringObject to work, the object needs to have an override Enable = FALSE to explicitly disable the discovery rule and for Remove-DisabledMonitoringObject to work.

So, you’ll still need to remove these objects from the original group you created to enable their discovery.  From there, you can follow two paths.

1.  We could create a group, populate it with only those objects we want to remove, disable override the discovery for that group, and run the cmdlet.  Then, to keep things nice and tidy, we need to delete our group we just created to remove those agents.  But that’s a lot of work!

2.  Change the enable parameter for our original discovery override to false, run the cmdlet.  Then change the enable back to true.  This will, in effect, remove all disabled monitoring objects from discovered inventory then add them back…but this time, without the objects you intend to remove.

I hope I made sense out of removing optional discovery rule inventory…

Comments (25)

  1. You might need to run it multiple times to remove all inventory, especially in loaded environments when removing a high volume of objects.  This is because there is a timeout on the procedure that this cmdlet executes.

  2. Anonymous says:

    We received an important reminder today from the product group about manually editing the database, and

  3. Anonymous says:

    Well first of all I really encourage you to upgrade to OM 2012 because it really brings a lot of features

  4. @Sergey – Unfortunately, even if I had a solution for this I could not publish it, because this would go directly against product group support statement

  5. Any thoughts on those computers which are discovered under AD Topolgy discovery but still does not removed after enabling discover agent only option as override. So tried by disabling the discovery rule for AD topology and ran this cmdlet many times. Also mofied the interval tovery  frequent in discovery rule before running the cmdlet.

  6. I believe it is Remove-SCOMDisabledClassInstance

  7. Hi Ramila,

    If any objects are in a grey "state", this means that monitoring workflows targeting that object are not running due to some issues with the Health Service.  It usually comes down to the Health Service not running, or the computer is unresponsive or unreachable.


  8. @great – yes, some of these cluster deletion issues were resolved in the CU's.

    @Andre's – I haven't heard any issues with this cmdlet not working as described.  Make sure you have the discoveries disable for the instances you want to delete.  I don't have experience removing x-plat instances, though, so maybe you would find the Technet forums more helpful in that area.…/systemcenteroperationsmanager

  9. Hi Ramila,

    There are plenty of discussions in the forums and blogs around how to troubleshoot grey agents.  The first step is to restart the Health Service on the Agent and look in the Operations Manager event log for any warning and error events.  Anything beyond that would need to be taken up in a forum with your peers.  Sorry, I can’t help much here in the comments of this post.

    Try here:


  10. Hi – The product group specifically asks that we do not ever remove discovered inventory by updating the database directly.  They say this will cause corruption eventually.  Even though this appears to remove the object, it is not recommended.  I would suggest using the Technet forums for further advice.  If you cannot get the results you seek there, then I suggest opening a case with Microsoft to resolve the issue.

  11. Shindhe,

    That's right.  Remove-DisabledMonitoringObject removes inventory that was discovered where the discovery enabled property has been set to False (aka, disabled).


  12. @dipeshr – make sure your management server action account is a member of the SCOM Administrators user role for agent-only option to work on this discovery, because there is a Powershell script that runs in this case and call get-agent.  If the MSAA doesn't have SCOM Admin privileges, the discovery cannot execute the cmdlet.

  13. Anonymous says:

    Hi Jonathan!

    Do you know how to remove disabled monitoring objects directly from Operations Manager Database (by sql query)?

    Thank you!

  14. Thanks Jonathan. Yes, i have verified that management server action account is a member of SCOM administrator. I do not see any errors or information of powershell script also. I ran get-agent command to verify that agent is not in list and even verified the directory for powershell as well.

  15. MAM2CAT says:

    I want to un-discover a number of SQL 2008 servers. I have created a group containing the 'Windows Computers' I am interested in. I have then searched the Object Discoveries for SQL Server 2008. There are 18 discoveries returned…..! DoI need to set the override against each of these 18 discoveries? If so, will the group I have previously set up that contains the SQL Server 2008 'Windows Computers' be sufficient or should I be creating more specific groups.    Seems an awful lot of work just to simply undiscover an occurence of a SQL Server 2008 server. Thanks M

  16. Ramila says:

    I wonder to know that whay some time  the in the Discovered Inventory the state of the comuter is gry but insted of green?

  17. Ramila says:

    Thanks. Jonathan. your answer was so helpfull.

    I wonder to know that how can I fix the problem?

    what is  the next step If I want to solve this problem


  18. Shindhe says:

    Wonderful info!!! Remove-DisabledMonitoringObject will only remove inventory that has already been discovered, for objects that have an override for Enable = FALSE explicitly for the discovery rule but what happens when we upgrade the MP from one version (Enable = FALSE) to another version (ENABLE = TRUE) still the Remove-DisabledMonitoringObject works i suspect because in our case it's not removing the lingering instances of previous version.

  19. great says:

    great help!!  i was suffering after shutting down a cluster, several gray resources groups.

    Anyway i think this issue is solved with CU2, can you confirm this please?


  20. Andrés says:

    I'm trying to use this cmdlet and it seems that is not working properly. First of all, it seems that arguments -WhatIf and -Confirm are not working at all. Apart from this issue, the cmdlet is not deleting objects in some circustances. I'm trying to remove some Solaris 9 Logical Disks discovered by the Solaris 9 Operative System MP without success. Has anyone else had problems removing discovered objects?

  21. Ramesh says:

    I used to run the "Remove-DisabledMonitoringObject" cmdlet without any issues, but of late it's giving this timed out error! Any ideas?


    Remove-DisabledMonitoringObject : The requested operation timed out.

    At line:1 char:31

    + Remove-DisabledMonitoringObject <<<<

  22. Marthijn says:

    i tried every thing, but my  specific computer did not have any discovery rules related. I also did a manual database grooming but the computer stil shows up in the console. I ended up by brutaly removing the computer from the database with:

    UPDATE [OperationsManager].[dbo].[BaseManagedEntity] SET [IsDeleted] = 1   WHERE [DisplayName] LIKE ''

    This seems to work.

    Do you have any recommendations on this? It seems to be the wrong way, but it looks like i have no other option.

    thanks in advance,


  23. Chinmay says:

    I have a problem with a bad MP that causes all instances of  Windows Computer to be added as an Instance of Windows Server. I have disabled the Windows Server Discovery rule for the class Windows Client. Running Remove-DisabledMonitoringObject did not help. Will this only work for explicit Groups? Can I use native groups like Windows Client Computer Group or Windows Client Instance Group?

  24. Mat says:

    Hi Jonathan

    I tried to delete some objects, which are disabled (grey) in the Windows Computers View. In the Discovered Inventory I can display them for example with the traget type Windows Server.

    Then under Authoring>Object discoveries I put the scope on Windows Server 2003 Computer and did an override "For a specific object of class: Windows Server">one of the disabled servers and changed enabled to false. Then I run Remove-DisabledMonitoringObject, but nothing happened. The server still appears… what have I done wrong? Is it relevant which management pack objects (how I wrote, I took in my try "Windows Server 2003 Computer) I choose?


  25. Any idea what the "Remove-DisabledMonitoringObject" PS command is in SCOM 2012?

Skip to main content