For over two decades, the Windows Management Instrumentation Command-line (WMIC) tool served as the go-to utility for querying system information, managing processes, configuring hardware, and automating administrative tasks from the Windows command line. However, Microsoft officially deprecated WMIC in Windows 11 (starting with version 22H2) and is progressively removing it from future Windows releases.
The recommended replacement is PowerShell’s CIM (Common Information Model) cmdlets, specifically Get-CimInstance, Set-CimInstance, Invoke-CimMethod, and New-CimSession. This guide explains what has changed, why WMIC was deprecated, and how to migrate every common WMIC workflow to its PowerShell CIM equivalent.
Why Did Microsoft Deprecate WMIC?
Microsoft’s decision to deprecate WMIC was driven by several factors:
- PowerShell provides a superior interface — CIM cmdlets return structured objects rather than plain text, making them far easier to filter, sort, export, and pipe into other commands.
- Security improvements — PowerShell supports modern authentication methods, constrained language modes, and script block logging that WMIC cannot leverage.
- Consistency — CIM cmdlets use the same WMI/CIM data providers as WMIC but present them through PowerShell’s standardised object pipeline.
- Remote management — CIM sessions use WS-Man (WinRM) by default, which is firewall-friendly, encrypted, and more reliable than WMIC’s DCOM-based remote connections.
- Maintenance burden — maintaining two separate command-line interfaces (WMIC and PowerShell) for the same underlying data was no longer justifiable.
What Does Deprecation Mean in Practice?
Deprecation does not mean immediate removal. Here is the timeline:
- Windows 11 22H2 onwards — WMIC is deprecated but still available. Running
wmicdisplays a deprecation warning. - Future Windows releases — WMIC will be moved to an optional “Features on Demand” package, then eventually removed entirely from default installations.
- Windows Server — follows a similar deprecation path, though typically on a slower timeline.
If you currently rely on WMIC in scripts, batch files, or manual workflows, now is the time to migrate.
Understanding the CIM Cmdlet Family
PowerShell’s CIM cmdlets provide full access to the same WMI classes that WMIC queries, but through a modern, object-oriented interface:
- Get-CimInstance — queries WMI/CIM classes and returns structured objects. This is the direct replacement for
wmic <alias> get. - Set-CimInstance — modifies the properties of a CIM instance.
- Invoke-CimMethod — calls methods on CIM classes or instances (e.g., terminating a process, enabling a device).
- New-CimSession — creates a persistent remote session for querying multiple machines without re-authenticating.
- Get-CimClass — inspects the properties and methods of a WMI class.
Common WMIC Commands and Their PowerShell Equivalents
System Information
WMIC:
wmic os get Caption, Version, BuildNumber, OSArchitecture
PowerShell:
Get-CimInstance -ClassName Win32_OperatingSystem | Select-Object Caption, Version, BuildNumber, OSArchitecture
Computer Model and Manufacturer
WMIC:
wmic computersystem get Manufacturer, Model, TotalPhysicalMemory
PowerShell:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object Manufacturer, Model, TotalPhysicalMemory
BIOS Information
WMIC:
wmic bios get SerialNumber, Manufacturer, SMBIOSBIOSVersion
PowerShell:
Get-CimInstance -ClassName Win32_BIOS | Select-Object SerialNumber, Manufacturer, SMBIOSBIOSVersion
CPU Information
WMIC:
wmic cpu get Name, NumberOfCores, NumberOfLogicalProcessors, MaxClockSpeed
PowerShell:
Get-CimInstance -ClassName Win32_Processor | Select-Object Name, NumberOfCores, NumberOfLogicalProcessors, MaxClockSpeed
Installed Memory (RAM) Modules
WMIC:
wmic memorychip get Capacity, Speed, Manufacturer, PartNumber
PowerShell:
Get-CimInstance -ClassName Win32_PhysicalMemory | Select-Object Capacity, Speed, Manufacturer, PartNumber
Disc Drive Information
WMIC:
wmic diskdrive get Model, Size, MediaType, InterfaceType
PowerShell:
Get-CimInstance -ClassName Win32_DiskDrive | Select-Object Model, Size, MediaType, InterfaceType
Listing Running Processes
WMIC:
wmic process get Name, ProcessId, WorkingSetSize
PowerShell:
Get-CimInstance -ClassName Win32_Process | Select-Object Name, ProcessId, WorkingSetSize
Terminating a Process
WMIC:
wmic process where "Name='notepad.exe'" call Terminate
PowerShell:
Get-CimInstance -ClassName Win32_Process -Filter "Name='notepad.exe'" | Invoke-CimMethod -MethodName Terminate
Listing Installed Software
WMIC:
wmic product get Name, Version, Vendor
PowerShell:
Get-CimInstance -ClassName Win32_Product | Select-Object Name, Version, Vendor
Note: Win32_Product triggers a consistency check on every installed MSI package, which is slow and can cause side effects. For faster results, query the registry instead:
Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher
Listing Services
WMIC:
wmic service get Name, State, StartMode
PowerShell:
Get-CimInstance -ClassName Win32_Service | Select-Object Name, State, StartMode
Network Adapter Configuration
WMIC:
wmic nicconfig where "IPEnabled=True" get Description, IPAddress, DefaultIPGateway, MACAddress
PowerShell:
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration -Filter "IPEnabled=True" | Select-Object Description, IPAddress, DefaultIPGateway, MACAddress
Startup Programmes
WMIC:
wmic startup get Caption, Command, Location
PowerShell:
Get-CimInstance -ClassName Win32_StartupCommand | Select-Object Caption, Command, Location
Filtering and Formatting Output
One of the biggest advantages of CIM cmdlets over WMIC is PowerShell’s object pipeline. You can filter, sort, and format results with standard cmdlets:
Filtering with Where-Object
Get-CimInstance -ClassName Win32_Service | Where-Object { $_.State -eq 'Running' -and $_.StartMode -eq 'Auto' } | Select-Object Name, DisplayName
Sorting Results
Get-CimInstance -ClassName Win32_Process | Sort-Object WorkingSetSize -Descending | Select-Object -First 10 Name, ProcessId, @{Name='MemoryMB';Expression={[math]::Round($_.WorkingSetSize/1MB,2)}}
Exporting to CSV
Get-CimInstance -ClassName Win32_DiskDrive | Select-Object Model, Size, MediaType | Export-Csv -Path "$env:USERPROFILE\Desktop\Disks.csv" -NoTypeInformation
Exporting to JSON
Get-CimInstance -ClassName Win32_OperatingSystem | Select-Object Caption, Version, BuildNumber | ConvertTo-Json
Remote Computer Queries with CIM Sessions
WMIC supported remote queries via the /node: parameter. The CIM equivalent is more robust:
$session = New-CimSession -ComputerName "Server01"
Get-CimInstance -CimSession $session -ClassName Win32_OperatingSystem
Remove-CimSession $session
CIM sessions use WS-Man (WinRM) by default, which is encrypted and uses standard HTTP/HTTPS ports. For legacy systems that only support DCOM:
$options = New-CimSessionOption -Protocol Dcom
$session = New-CimSession -ComputerName "LegacyServer" -SessionOption $options
Migrating WMIC Batch Scripts
If you have existing .bat or .cmd scripts that use WMIC, the migration process is straightforward:
- Identify every
wmiccommand in your script. - Map each WMIC alias (e.g.,
os,cpu,diskdrive) to its WMI class name (e.g.,Win32_OperatingSystem,Win32_Processor,Win32_DiskDrive). - Replace the WMIC syntax with the equivalent
Get-CimInstancecall. - Convert the batch script to a
.ps1PowerShell script. - Test thoroughly before deploying to production.
The transition from WMIC to PowerShell CIM cmdlets is more than a simple syntax change — it unlocks a fundamentally more powerful, secure, and maintainable approach to Windows system management that will serve you well into the future.