I’ve encountered a strange problem the other day at one of our clients:
The client enabled a discovery via an override for a class discovery which is disabled by default.
After deciding to remove this override in order to clear the class, the class instances refused to leave an nothing append.
I know what you think, “you need to run the Remove-SCOMDisabledClassInstance cmdlt via powershell in order to clean the class”…
But I’ve already tried it and still nothing append…
After some testing and searching I’ve came across a great post by Jan Van Meirvenne.
The reason that the class instances are stuck in the class is because the class discovery is disabled by default. I turns out that the PS cmdlt skip a disabled discoveries
In order to get the cmdlt to remove the class instances you need to create a temporary override which turns the enabled parameter to false(even due it disabled from the first place) and enforced the override.
After doing so, re-run the cmdlt via powershell and wait for it to end successfully.
Notice that the process may take a good few minutes to end (in my case – 26 min)
Now you can check and see that everything is squeaky clean
P.S. Don’t forget to delete the temporary override you created in order to enforce the disabling of the discovery.