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

Return discovered inventory

Return discovered inventory

Rate This
  • Comments 2

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

What do you think about this post?
Leave a Comment
  • Post
What others have said about this post...
Comments
  • 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.

Page 1 of 1 (2 items)