The Common Information Model (CIM), commands are:
Get-CimAssociatedInstance
Get-CimClass
Get-CimInstance
Get-CimSession
Invoke-CimMethod
New-CimInstance
New-CimSession
New-CimSessionOption
Register-CimIndicationEvent
Remove-CimInstance
Remove-CimSession
Set-CimInstance
Each of the CIM cmdlets uses either the ComputerName
or CimSession
parameter to target the operation at another computer.
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...