PowerShell List all Object Discoveries targeted to Windows Servers

October 13 2008, 3:50pm

I’m currently trying to find a way to automatically create overrides for Object Discoveries targeted to Windows Servers. More to come soon I hope ;-) But before doing that I wanted to find all Object Discoveries targeted to Windows Server first. And with the help of some PowerShell friends (first Jeremy Pavleck then Marco Shaw) I was able to find a way to do that with PowerShell. Just open the OpsMgr Command Shell and run the next command. (change the class if you want to). # Enumerate OpsMgr 2007 Object Discoveries targeted to Windows Server # Date: 13/10/2008 # Author: Stefan Stranger (help from Jeremy Pavleck and Marco Shaw) get-discovery |? {$.Target -match (get-monitoringclass | where {$.Name -eq "Microsoft.Windows.Server.Computer"}).Id} | select Name, DisplayName   You can download the script from the PowerShell Code Repository.