Command Shell Examples
Useful SQL Queries
Return discovered inventory - Jonathan Almquist on Operations Manager - Site Home - TechNet Blogs

Return discovered inventory

Return discovered inventory

  • Comments 2
  • Likes

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

I do not moderate this blog anymore. If you have a question regarding this post, send me a message.

  • Jonath,

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

  • 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.