Return discovered inventory

Just playing around today and thought I’d make this little post on how to return discovered inventory in Command Shell.  This one in particular will return all disk sizes discovered, convert to GB and round to the nearest 1.

get-MonitoringClass | where {$_.Name -like "Microsoft.Windows.Server.200?.LogicalDisk"} | get-MonitoringObject | get-MonitoringObjectProperty | Where {$_.Name -eq "SizeNumeric"} | Select @{Name="GB";Expression={[Math]::Round($_.Value / 1024, 0)}}


This is what I call fun!


Command Shell Reference

Comments (2)

  1. Jim – you can just copy the code and paste directly into a command shell session. BTW – this is for OpsMgr 2007. You'll need to update the cmdlet's if running in OpsMgr 2012 environment.

  2. jim says:


    Could you please let me know how to run this script to get the output.