October 2017
Intermediate to advanced
440 pages
11h 47m
English
The Get-CimInstance command is used to execute queries for instances of WMI objects. For example:
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:
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 Name, SID
The
Read now
Unlock full access