Would you like to learn how to use Powershell to perform CIM queries? In this tutorial, we are going to show you how to perform a CIM query using the Powershell command-line on a computer running Windows.

• Windows 2012 R2
• Windows 2016
• Windows 2019
• Windows 10
• Windows 7

Equipment list

The following section presents the list of equipment used to create this tutorial.

As an Amazon Associate, I earn from qualifying purchases.

Tutorial Powershell - Perform a CIM query

As an Administrator, start an elevated Powershell command-line.

Windows 10 - powershell elevated

List the Powershell CMDLETS available for work with CIM.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Query all available Namespaces.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Get a complete recursive view of all namespaces available on your system.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Get all the class definitions from a Namespace.

Copy to Clipboard

If no namespace is specified, the system uses CIMV2 as the default.

Here is the command output.

Copy to Clipboard

Classes that start with CIM follow the original concept of the COMMON INFORMATION MODEL.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Classes that start with WIN32 usually are Microsoft extended implementations of a CIM class.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Classes that start with MSFT are Microsoft exclusive classes that do not inherit from CIM.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

List all properties name from a WMI class.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

List all properties from a class.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Query a specific property from a WMI class.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Get only the value of a property from a WMI class.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

There are multiple ways to query only the value of a WMI property.

Copy to Clipboard

List multiple properties from a class.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Display the WMI query result as a list instead of a table.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Optionally, format the output as a grid.

Copy to Clipboard

Here is the command output.

Powershell - CIM Query

Congratulations! You are able to perform CIM queries using Powershell.