Practical Linux, Windows Server and cloud guides for IT pros.

WMI and CIM Commands for Windows Troubleshooting

A practical WMI and CIM command reference for Windows troubleshooting, grouped by services, boot time, BIOS, computer system, and video controller checks, with modern Get-CimInstance examples.

Filed under

, , ,

Published

Written by

Last updated

GitHub CLI Login Status Terminal Output

WMI is still one of the most useful Windows troubleshooting tools, but the way most admins use it has changed. Older examples often start with Get-WmiObject. For new scripts and day-to-day checks, use Get-CimInstance where possible and query the same familiar Win32_* classes.

This guide turns the original WMI command list into a cleaner troubleshooting reference. Use the index first, then jump to the section that matches what you are checking.

TL;DR

  • Use Get-CimInstance for modern PowerShell examples.
  • Use WMI classes such as Win32_Service, Win32_OperatingSystem, Win32_BIOS, Win32_ComputerSystem, and Win32_VideoController.
  • Prefer selecting the fields you need instead of returning every property.
  • Use Get-WmiObject mainly for older Windows PowerShell scripts or legacy systems.

Source check: Microsoft documents Get-CimInstance, legacy Get-WmiObject, and the broader Windows Management Instrumentation platform.

Command Index

Task Class or cmdlet Use it for
List service details Win32_Service Service state, startup mode, account, and description
Find last boot time Win32_OperatingSystem Uptime and OS inventory checks
Get BIOS details Win32_BIOS Serial number, BIOS version, and release date
Get computer model Win32_ComputerSystem Manufacturer, model, system type, and memory
Get video card details Win32_VideoController GPU name, driver version, and adapter information
Run checks remotely -ComputerName or CimSession Remote inventory and troubleshooting

WMI vs CIM

Use Recommended command Notes
Modern PowerShell checks Get-CimInstance Best default for current scripts and examples.
Legacy Windows PowerShell scripts Get-WmiObject Useful when maintaining older scripts.
Class discovery Get-CimClass Use this to find available WMI/CIM classes.

Before You Run These Commands

  • Run PowerShell as an account with permission to read system inventory on the target computer.
  • For local checks, start with Get-CimInstance and a specific class name.
  • For remote checks, confirm firewall and remote management settings before assuming the command is wrong.
  • When output is too wide, pipe to Select-Object or Format-List.

Services

Services are one of the best places to use WMI/CIM because the Win32_Service class exposes details that basic service commands do not always show, such as startup account and service description.

List useful service properties

Get-CimInstance -ClassName Win32_Service |
    Select-Object Name, State, StartMode, StartName, Description

This is a better first check than selecting every property. It keeps the output readable and still shows the fields most admins need.

Find running automatic services

Get-CimInstance -ClassName Win32_Service -Filter "State='Running' AND StartMode='Auto'" |
    Select-Object Name, State, StartMode, Description

Use this when you want to confirm which automatically-started services are currently running.

Legacy WMI equivalent

Get-WmiObject -Class Win32_Service |
    Select-Object Name, State, StartMode, StartName

Keep this version for older Windows PowerShell examples or scripts you have not migrated yet.

Boot Time and Operating System Details

The Win32_OperatingSystem class is useful for uptime checks, patch investigations, and quick OS inventory.

Find the last boot time

Get-CimInstance -ClassName Win32_OperatingSystem |
    Select-Object CSName, Caption, Version, LastBootUpTime

With CIM output, LastBootUpTime is already returned in a readable date format, so the old ConvertToDateTime() step is usually unnecessary.

Return only the date

(Get-CimInstance -ClassName Win32_OperatingSystem).LastBootUpTime.ToShortDateString()

Use this when you only need the boot date and not the full timestamp.

BIOS Information

BIOS details are useful when you need a serial number, firmware version, or quick hardware identity check.

Get-CimInstance -ClassName Win32_BIOS |
    Select-Object Manufacturer, SMBIOSBIOSVersion, SerialNumber, ReleaseDate

This returns a compact BIOS report without dumping every property in the class.

Computer System Information

Use Win32_ComputerSystem when you need model and platform information for a workstation, server, or virtual machine.

Get-CimInstance -ClassName Win32_ComputerSystem |
    Select-Object Name, Manufacturer, Model, SystemType, TotalPhysicalMemory

If you need the memory value in GB, create a calculated property:

Get-CimInstance -ClassName Win32_ComputerSystem |
    Select-Object Name, Manufacturer, Model, SystemType,
        @{Name='MemoryGB';Expression={[math]::Round($_.TotalPhysicalMemory / 1GB, 2)}}

Video Card Information

The Win32_VideoController class is helpful for driver checks, display troubleshooting, and confirming what Windows sees as the installed GPU.

Get a concise video card report

Get-CimInstance -ClassName Win32_VideoController |
    Select-Object Name, AdapterCompatibility, DriverVersion, VideoModeDescription

Include adapter memory

Get-CimInstance -ClassName Win32_VideoController |
    Select-Object Name, DriverVersion,
        @{Name='AdapterRAMGB';Expression={[math]::Round($_.AdapterRAM / 1GB, 2)}}

Adapter memory values can vary by driver and hardware type, so treat this as a quick Windows inventory check rather than a hardware audit.

Remote WMI and CIM Checks

For a single remote computer, -ComputerName is often enough.

Get-CimInstance -ClassName Win32_OperatingSystem -ComputerName 'Server01' |
    Select-Object CSName, Caption, LastBootUpTime

For repeated checks against the same server, create a CIM session.

$session = New-CimSession -ComputerName 'Server01'

Get-CimInstance -ClassName Win32_ComputerSystem -CimSession $session |
    Select-Object Name, Manufacturer, Model

Remove-CimSession -CimSession $session
Remote command troubleshooting

If a remote CIM command fails, check name resolution, permissions, firewall rules, WinRM configuration, and whether remote administration is allowed on the target system.

Find More WMI Classes

Once you know the pattern, you can discover other useful classes with Get-CimClass.

Get-CimClass -ClassName Win32_* |
    Select-Object CimClassName

You can narrow the list when you know the kind of object you are looking for:

Get-CimClass -ClassName Win32_*Disk*

Common Mistakes

  • Returning every property by default: Select-Object * is useful for exploration, but it can make the page or terminal output hard to read.
  • Using old aliases in examples: avoid gwmi in shared documentation because it is less clear for beginners.
  • Assuming remote failures are syntax errors: many remote WMI/CIM failures are caused by access, firewall, or WinRM configuration.
  • Mixing formatting with reusable data: use Select-Object while building pipelines, then add Format-Table or Format-List only for final display.

Related TurboGeek Guides

Final Notes

WMI and CIM commands are most useful when they are focused. Pick the class that matches the troubleshooting question, select only the properties you need, and use remote CIM sessions when you need to run repeated checks against the same system.

Leave a Reply

Your email address will not be published. Required fields are marked *

Find more on the site

Keep reading by topic.

If this post was useful, the fastest way to keep going is to pick the topic you work in most often.

Want another useful post?

Browse the latest posts, or support TurboGeek if the site saves you time regularly.

Translate ยป