February 2019
Intermediate to advanced
626 pages
15h 51m
English
The Get-CimInstance command is used to execute queries for instances of WMI objects, an example is as follows:
Get-CimInstance -ClassName Win32_OperatingSystem Get-CimInstance -ClassName Win32_Service Get-CimInstance -ClassName Win32_Share
A number of different parameters are available when using Get-CimInstance. The command can be used with a filter, as follows:
Get-CimInstance Win32_Directory -Filter "Name='C:\\Windows'" Get-CimInstance CIM_DataFile -Filter "Name='C:\\Windows\\System32\\cmd.exe'" Get-CimInstance Win32_Service -Filter "State='Running'"
When returning large amounts of information, the Property parameter can be used to reduce the number of fields returned by a query:
Get-CimInstance Win32_UserAccount -Property ...
Read now
Unlock full access