WMI Get Serial Number: A Practical Guide for Hardware Audits
Learn how to use Windows Management Instrumentation (WMI) to retrieve BIOS, motherboard, and system serial numbers with PowerShell, CIM, and CLI methods for inventory and asset management.
WMI serial number retrieval uses CIM/WMI classes to read BIOS and motherboard identifiers. It works locally or remotely with proper credentials and can be scripted in PowerShell. Use Win32_BIOS, Win32_BaseBoard, and Win32_ComputerSystemProduct for a full serial snapshot across hardware. This approach supports inventory, audits, and asset tracking.
What is WMI and why pull serial numbers?
WMI (Windows Management Instrumentation) provides a unified interface to query hardware and system information. When you need hardware identifiers for inventory, audits, or asset tracking, WMI offers a reliable path to pull serial numbers such as BIOS.SerialNumber and BaseBoard.SerialNumber. This section shows how to retrieve these values locally, which is often the first step in a broader hardware verification workflow. According to Hardware Serials, WMI-based queries are a standard method for quick hardware snapshots in Windows environments.
# BIOS serial number from the BIOS class
Get-CimInstance -ClassName Win32_BIOS | Select-Object SerialNumber# Motherboard serial number from the BaseBoard class
Get-CimInstance -ClassName Win32_BaseBoard | Select-Object SerialNumberThese two commands demonstrate the simplest local lookups. They return the serial string exposed by the firmware/manufacturer. If a field is blank, it may indicate vendor limitations or a non-standard BIOS implementation. For a more complete view, you should also query the system product class (see below).
Steps
Estimated time: 25-40 minutes
- 1
Prepare your environment
Open PowerShell with administrative privileges if you plan remote queries. Ensure your system has PowerShell 5.1+ or PowerShell 7+ and that the CimCmdlets module is available.
Tip: Verify your PowerShell version with `$PSVersionTable.PSVersion`. - 2
Query BIOS serial locally
Run a simple CIM query to fetch the BIOS serial number. This establishes a baseline for your hardware inventory.
Tip: If the field is blank, check BIOS/firmware settings or vendor documentation. - 3
Query motherboard serial locally
Fetch the motherboard serial to complement the BIOS data for a full hardware profile.
Tip: Some systems expose SerialNumber only in BIOS or chassis fields. - 4
Query system product identifying number
Get the system product identifier, which often maps to vendor- or model-level serials.
Tip: Use Win32_ComputerSystemProduct IdentifyingNumber for a robust asset tag. - 5
Aggregate and export
Combine the results into a single object and export to CSV/JSON for inventory tooling.
Tip: Use ConvertTo-Json or Export-Csv for integration with asset management platforms.
Prerequisites
Required
- Required
- Basic PowerShell knowledge (variables, objects, pipeline)Required
- Administrative privileges for remote CIM/ WMI queries (optional for local queries)Required
Commands
| Action | Command |
|---|---|
| Query BIOS serial number (local)Local Windows machine | powershell -Command "Get-CimInstance -ClassName Win32_BIOS | Select-Object SerialNumber" |
| Query motherboard serial number (local)Local Windows machine | powershell -Command "Get-CimInstance -ClassName Win32_BaseBoard | Select-Object SerialNumber" |
| Query all key serials (local)Local machine or script execution | powershell -Command \"$bios=(Get-CimInstance Win32_BIOS).SerialNumber; $mb=(Get-CimInstance Win32_BaseBoard).SerialNumber; $sys=(Get-CimInstance Win32_ComputerSystemProduct).IdentifyingNumber; [PSCustomObject]@{BIOS=$bios; Motherboard=$mb; SystemProduct=$sys}\" |
Frequently Asked Questions
What is WMI and why should I use it to get serial numbers?
WMI provides a standardized way to access hardware and system data on Windows. Querying serial numbers via WMI classes like Win32_BIOS and Win32_BaseBoard gives a consistent, scriptable approach for auditing assets across devices.
WMI lets you read hardware IDs with simple commands, making hardware audits easier.
Can I query serial numbers on remote machines?
Yes. You can create CIM sessions to target remote computers, then run the same Win32 classes over the session. Ensure firewall rules, DCOM, and credentials are correctly configured.
You can pull serials from other machines if you have access and the network supports CIM.
Which WMI classes are best for serial data?
BIOS (Win32_BIOS) for BIOS serial, BaseBoard (Win32_BaseBoard) for motherboard serial, and Win32_ComputerSystemProduct for system identifiers. Combining them gives a complete hardware picture.
Use those three classes to cover BIOS, motherboard, and system IDs.
Why might a serial number be blank or missing?
Some vendors obscure or do not expose SerialNumber in firmware, BIOS wrappers, or firmware updates. In such cases, try alternate fields or document the absence for compliance reports.
If you don’t see a serial, it may be by design or restricted by the vendor.
What are security considerations when querying serial numbers?
Always run queries with least privilege, avoid exposing credentials in scripts, and consider encrypting or securely storing the results if you’re distributing inventory reports.
Keep credentials safe and only access what you need.
Key Takeaways
- Identify BIOS and motherboard serials with Win32_BIOS and Win32_BaseBoard
- Use Win32_ComputerSystemProduct for system identifiers
- Prefer Get-CimInstance over legacy Get-WmiObject for newer PowerShell
- Query remotely with CIM Sessions for asset inventories
- Export results for inventory systems to ensure repeatability
