WMI Device Inventory

by Aug 26, 2014

All PowerShell Versions

The WMI service can report plenty of details about the computer hardware. Typically, each type of hardware is represented by its own WMI class. It's not easy to find out the names of such hardware classes, though.

Since all hardware classes descend from the same root WMI class (CIM_LogicalDevice), you can use this root class to find all hardware:

Get-WmiObject -Class CIM_LogicalDevice | Out-GridView 

This will return a basic hardware inventory. But you can do even more. With a little extra code, you get a list of hardware class names used by WMI:

Get-WmiObject -Class CIM_LogicalDevice | 
  Select-Object -Property __Class, Description |
  Sort-Object -Property __Class -Unique |
  Out-GridView 

You can now use any of these class names to query for a particular type of hardware and find out hardware details:

 
PS> Get-WmiObject -Class Win32_SoundDevice

Manufacturer        Name                Status                       StatusInfo
------------        ----                ------                       ----------
Cirrus Logic, Inc.  Cirrus Logic CS4... OK                                    3
Intel(R) Corpora... Intel(R) Display... OK                                    3
 

Twitter This Tip! ReTweet this Tip!