Finding Discovered Inventory with SCOM (2007, 2012 and 2016)

Whilst we can find out what SCOM has discovered quite easily from the Operations Manager Console, sometimes you want to export this information or simply use powershell or a script.

So let’s find out how many Servers are running a Windows 2008, IIS WebServer. So the first thing I needed to do is find out what the Class was that I needed for my query.

For that, I started with a generic query to find out what IIS Classes there were…

get-monitoringclass | ? {$_.Name -like “*Internet*”} | select Name

Looking at the output, I decided the most likely Class was “Microsoft.Windows.InternetInformationServices.2008.WebServer”. Using this class, I could now find out what servers were running an Windows 2008, IIS WebServer.

Get-MonitoringClass -name “Microsoft.Windows.InternetInformationServices.2008.WebServer” | Get-MonitoringObject | Select Path

 

In SCOM 2012 and SCOM 2016 its similar but slightly different as the cmdlet names have changed.

Get-SCOMClass –name “Microsoft.Windows.InternetInformationServices.2008.WebServer” | Get-SCOMClassInstance | Select Path

 

If you want to find out how many items you have discovered, you can wrap this all up in parenthesis and look for the count.

For SCOM 2007:

(Get-MonitoringClass -name “Microsoft.Windows.InternetInformationServices.2008.WebServer” | Get-MonitoringObject | Select Path).count

 

For SCOM 2012 and SCOM 2016:

(Get-SCOMClass –name “Microsoft.Windows.InternetInformationServices.2008.WebServer” | Get-SCOMClassInstance | Select Path).count

 
Comments

No comments yet.

Leave a Reply