Summery
CIM is an interface used to query system information, such as services, processes, and hardware.
Windows’ version of CIM is actually WMI. WMI actually uses CIM underneath.
Commands
Get-CimInstance Win32_ComputerSystem | Select Domain,PartOfDomain - Check if your host is in a domain or not.
Get-CimInstance -Class win32_quickfixengineering | Where-Object { $_.Description -eq "Security Update" } - Get exact security patches installed on the system
Get-CimInstance Win32_StartupCommand | select Name, command, Location, User |fl - Check for start-up programs
Get-CimInstance -ClassName win32_service | Select Name,State,PathName | Where-Object {$_.State -like 'Running'} - List only running services
Get-CimInstance -ClassName win32_service | Select Name,State,PathName - List all services
Get-CimInstance Win32_Service -Filter "Name='<SERVICE NAME>'" | Format-List * - List all details of a specific service
Get-CimInstance Win32_Service | Where-Object {$_.PathName -notmatch "C:\\Windows\\" -and $_.PathName -notmatch '"'} | Select Name,State,PathName - Look for unquoted service paths
Get-CimInstance <PROCESS> | Select-Object ProcessId,Name,ParentProcessId,ExecutablePath, @{N="User";E={$_.GetOwner().Domain + "\" + $_.GetOwner().User}}, CommandLine - View detailed process information