PowerShell List all Object Discoveries targeted to Windows Servers

PowerShell List all Object Discoveries targeted to Windows Servers

  • Comments 1
  • Likes

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)
# Cory Delamarter (increased speed)
get-discovery |? {$_.Target -match (get-monitoringclass | where {$_.Name -eq "Microsoft.Windows.Server.Computer"}).Id} | select Name, DisplayName

get-discovery | ? {$_.Target -match $(get-monitoringclass -Name "Microsoft.Windows.Server.Computer").Id} | ft Name, DisplayName

You can download the script from the PowerShell Code Repository.

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment