Hi guys,

Common problem is that you have orphaned computer Objects in Windows server view. Usually these get removed automaticly after some time. But now i have Objects still Associated With a custom discovery written With PowerShell. and i Wonder if there is something i need to do With the actual script for this?

Basicly the script compares Objects in scom With Objects in Our cmdb and then adds exteded property to a New class based on Windows computer. Here’s a snippet of it.


Ehrnst edited question
    • Hi, This is a common problem. One solution for it is to get the healthservices from SCOM. (Get-SCOMClass -DisplayName "Health Service"| Get-SCOMClassInstance) And only set the properties if the object still has a healthservice. The objects which are not touched and don't have a health service anymore for a while will be removed from SCOM.
    • Thank you for Your reply. So you would suggest doing the match on healht service instead of Windows computer class? Martin
    • I'm not sure this will work as the discovery has not been disabled via an override (to my knowledge) so I've post as a comment. I recommend reading up on this PowerShell command as it can be pretty intensive on the databases. Remove-SCOMDisabledClassInstance https://technet.microsoft.com/en-us/library/hh920257(v=sc.20).aspx