Working with WMI CIM objects

WMI stands for Windows Management Instrumentation. It is a set of specifications or standards provided by Microsoft for standardized management of devices/applications in windows-based networks. WMI supports actions such as configuration of security settings, changing system properties, changing permissions for users, enable/disable error logging, scheduling processes to run at specific times etc.

CIM stands for Common Information Model. It is a computer industry standard for defining device or application properties/characteristics in order to help administrators to access and manage devices in the single standardized way.

WMI & CIM manage/handle many of the core functionalities on windows platform.

We can access WMI in powershell using Get-WmiObject cmdlet. This cmdlet provides information about the available WMI classes.

As shown in screenshot above, when used with ‘-list’ parameter, Get-WmiObject returns a long list of all available WMI objects on system.

We can get information related to specific WMI class by using â€"Class parameter as shown in screenshot below:

As you can see we have specified Win32_Desktop as parameter value and details/properties related to user desktop are provided as a result. You can use filters while looking for WMI objects through powershell. For example, if you are not sure about the name of a WMI class, you can provide some search text. Let’s take example of desktop again, as shown below:

Here, we have used ‘desktop’ as search text along with wildcard characters with â€"list parameter. The result is all WMI objects having ‘desktop’ included in their names.

You can also format the result of the Get-WmiObject in desired format:

Here, we have formatted output in tabular format. ‘|’ here is pipe which is used to form pipeline of cmdlets causing output of one cmdlet to act as input to the next one. Below are the different formats for formatting the output of cmdlets:

Format-Custom

Format-List

Format-BootSecureUEFI

Format-Volume

Format-Wide