How to Use the Windows Management Instrumentation Command-line (WMIC) for Hardware Audits

The Limits of the System Information App

When an IT administrator needs to know the serial number of a motherboard, the exact model of a RAM stick, or the BIOS version of a Windows PC, relying on graphical tools like msinfo32 or the Task Manager is inefficient. These tools are slow to navigate, and the data cannot be easily copied or exported into an automated inventory script.

For deep, scriptable hardware audits, Microsoft provides the Windows Management Instrumentation Command-line (WMIC). WMIC allows you to query the motherboard, processor, memory, and BIOS directly from the command prompt, returning precise hardware data instantly.

Essential Hardware Audit Commands

Open the Command Prompt (running as Administrator is recommended, though not strictly required for all queries) and type the following commands to extract specific hardware details.

1. Retrieving the Computer Serial Number

If you are managing a fleet of Dell or Lenovo laptops, finding the exact Service Tag or Serial Number usually requires physically flipping the laptop over and reading the faded sticker. WMIC can pull it directly from the BIOS.

wmic bios get serialnumber

You can also pull the make and model of the computer simultaneously:

wmic csproduct get vendor, name, identifyingnumber

2. Auditing the Processor (CPU)

To quickly check the exact model of the CPU installed in a machine, including its core count and architecture:

wmic cpu get name, NumberOfCores, NumberOfLogicalProcessors

3. Auditing the Memory (RAM)

Task Manager tells you how much RAM is installed (e.g., 16GB), but it doesn’t tell you the physical configuration. Are there two 8GB sticks? Or one 16GB stick? What speed are they running at? WMIC can tell you exactly what is slotted into the motherboard.

wmic memorychip get capacity, speed, manufacturer, partnumber

Note: The capacity is returned in bytes. You will need to mathematically convert the massive number to gigabytes (divide by 1,073,741,824).

4. Auditing the Hard Drives

To see a list of physical disk drives installed (not partitions like C: or D:, but the actual physical hardware):

wmic diskdrive get model, size, mediatype

This will clearly differentiate between traditional HDDs (Fixed hard disk media) and modern Solid State Drives.

Exporting the Audit to HTML or CSV

The true power of WMIC is its ability to instantly generate beautifully formatted reports that can be sent to management or ingested into an asset tracking database.

Instead of just printing the output to the command window, you can append an output format flag.

Exporting to HTML

To generate a highly readable HTML table of all installed software or hardware:

wmic /output:C:\hw_audit.html cpu get name, NumberOfCores /format:htable

You can then double-click the hw_audit.html file on your C: drive to view the results in a web browser.

Exporting to CSV

For database ingestion, Comma Separated Values (CSV) is preferred:

wmic /output:C:\hw_audit.csv memorychip get capacity, speed /format:csv

The Future of WMIC (PowerShell Migration)

It is important to note that Microsoft has officially deprecated the traditional wmic.exe tool in modern builds of Windows 11, pushing administrators toward the newer PowerShell equivalent (Get-WmiObject or Get-CimInstance).

While the classic WMIC syntax is simpler for rapid hardware checks, learning the PowerShell equivalent is vital for future-proofing your scripts. For example, the PowerShell equivalent to finding the BIOS serial number is:

Get-CimInstance Win32_BIOS | Select-Object SerialNumber

Conclusion

Whether you are using the classic wmic executable or modern PowerShell CIM commands, Windows Management Instrumentation provides the ultimate interface for hardware auditing. It eliminates the need for third-party inventory software, allowing administrators to pull exact physical specifications instantly from the command line.

RELATED POSTS

  • How to Change the Default RDP Port in Windows Server
  • How to Use the Windows 11 logman Command to Manage Performance Counters
  • How to Use the Windows 11 Resource Monitor to Find Memory Leaks
  • How to Automatically Hide the Taskbar in Windows 11
  • How to View Open Network Ports in Windows using the netstat Command
  • Get the best tech tips delivered straight to your inbox.

    Join thousands of readers mastering Apple, Google, Microsoft, and Linux.