wmic get bios serial number: A Practical Windows BIOS Serial Lookup Guide

Learn how to retrieve the BIOS serial number on Windows using wmic get bios serial number, with PowerShell CIM alternatives for future-proofing and automation. Includes practical examples, remote checks, and troubleshooting tips from Hardware Serials.

Hardware Serials
Hardware Serials Team
·5 min read
Quick AnswerSteps

To fetch a BIOS serial number on Windows, run the WMIC command: `wmic bios get serialnumber`. This returns the SerialNumber from the BIOS in a simple list. Note that WMIC can be deprecated on newer Windows builds, so also learn PowerShell alternatives such as `Get-CimInstance Win32_BIOS | Select-Object SerialNumber` for future compatibility. Steps: open CMD/PowerShell, execute the command, read the SerialNumber line, and verify against hardware records.

What WMIC and BIOS serial numbers mean

According to Hardware Serials, the BIOS serial number is a unique identifier stored in the system firmware. It helps with asset management, warranty lookups, and hardware inventory. The Hardware Serials team found that a quick Windows query can reveal this value without opening the case or relying on OEM software. This guide focuses on the classic WMIC method (wmic get bios serialnumber) and contrasts it with modern CIM-based PowerShell alternatives for ongoing compatibility.

PowerShell
# Basic WMIC approach (PowerShell can call CMD commands directly) wmic bios get serialnumber
PowerShell
# Modern PowerShell approach using CIM Get-CimInstance Win32_BIOS | Select-Object SerialNumber
  • The first snippet shows the legacy WMIC path that many admins remember.
  • The second snippet uses PowerShell CIM cmdlets that are designed for future Windows versions.

Basic usage: retrieving the BIOS serial number with WMIC

The classic path to fetch the BIOS serial number on Windows is straightforward: run the command in CMD or PowerShell. The result typically appears as a single value labeled SerialNumber. If you need a cleaner format, you can append formatting switches to control the output.

PowerShell
wmic bios get serialnumber
PowerShell
wmic bios get serialnumber /value

What these commands do:

  • The first prints a single line with the property name and value.
  • The second uses the /value switch to produce a name=value pair, which is easier to parse in scripts.

For automation, capture the value into a variable:

PowerShell
$sn = (wmic bios get serialnumber /value).Split("=")[1].Trim() Write-Output "SerialNumber=$sn"

Output variations and filtering: shaping the data for automation

Not all environments present output in a friendly format by default. You can force formats or filter properties to isolate the SerialNumber, which is crucial for inventory tooling. WMIC supports /format, and PowerShell can directly query WMI classes.

PowerShell
# List format, one per line wmic bios get serialnumber /format:list
PowerShell
# PowerShell approach: narrow extraction and handle nulls $bios = Get-CimInstance Win32_BIOS $serial = $bios.SerialNumber if ([string]::IsNullOrWhiteSpace($serial)) { Write-Warning 'Serial number not found' } else { Write-Output "SerialNumber: $serial" }

If you need to export to CSV for asset inventories:

PowerShell
Get-CimInstance Win32_BIOS | Select-Object PSComputerName, SerialNumber | Export-Csv -Path bios_serials.csv -NoTypeInformation

Alternatives for future-proofing: PowerShell CIM and remote queries

WMIC is convenient, but many admins migrate to CIM-based cmdlets for compatibility with newer Windows subsystems. CIM (Get-CimInstance) replaces WMI-based Get-WmiObject and aligns with RESTful principles. This section shows robust patterns for both local and remote collection.

PowerShell
# Local machine using CIM Get-CimInstance Win32_BIOS | Select-Object SerialNumber
PowerShell
# Remote collection with CIM and a list of targets $targets = 'PC01','PC02','PC03' foreach ($t in $targets) { Get-CimInstance -ClassName Win32_BIOS -ComputerName $t | Select-Object PSComputerName, SerialNumber }

For automation in fleets, prefer CIM with CIM sessions and error handling to avoid intermittent failures:

PowerShell
$session = New-CimSession -ComputerName PC01 -ErrorAction Stop Get-CimInstance -ClassName Win32_BIOS -CimSession $session | Select-Object SerialNumber Remove-CimSession -CimSession $session

Practical examples in real-world scenarios: scripts and cross-machine checks

This section demonstrates practical patterns you can drop into your IT operations. A single-machine script is handy for quick checks, while multi-host workflows enable fleet inventory and integrity checks. Remember to validate the results against hardware records for accuracy.

PowerShell
# Single-machine quick check $sn = (Get-CimInstance Win32_BIOS).SerialNumber Write-Output "BIOS Serial: $sn"
PowerShell
# Fleet inventory example with local JSON export $computers = @('PC1','PC2','PC3') $results = foreach ($c in $computers) { try { Get-CimInstance -ClassName Win32_BIOS -ComputerName $c | Select-Object PSComputerName, SerialNumber } catch { [PSCustomObject]@{ PSComputerName = $c; SerialNumber = $null; Error = $_.Exception.Message } } } $results | ConvertTo-Json | Out-File bios_inventory.json -Encoding utf8

Batch-file style retrieval for legacy scripts also exists:

BAT
@echo off for /f "tokens=*" %%A in ('wmic bios get serialnumber /value ^| findstr /R "SerialNumber"') do echo %%A

Troubleshooting and best practices: common issues and fixes

Running BIOS queries can fail for several reasons, from missing WMIC on a system to restricted WMI namespaces due to group policy. This section covers common issues and how to address them to keep your workflow resilient.

PowerShell
# Check WMI service status locally (Get-Service winmgmt).Status
PowerShell
# If WMI is not running, restart the service with caution Restart-Service -Name winmgmt -Force
PowerShell
# Basic cross-check: does the BIOS class exist? Get-CimClass -ClassName Win32_BIOS

If WMIC is not present, switch to CIM-based methods immediately:

PowerShell
# Quick fallback to CIM when WMIC is unavailable (Get-CimInstance Win32_BIOS).SerialNumber

Hardware Serials notes that WMIC availability varies across Windows versions and OEM configurations. In practice, CIM-based methods tend to be more reliable and forward-compatible. Always verify results against a known-good inventory source and secure credentials when querying remote machines.

Best practices and safety: protecting sensitive hardware data

Serial numbers are sensitive identifiers for devices. Treat them as confidential data when scripting, especially in multi-user or cloud environments. Use secure channels, least-privilege access, and avoid logging sensitive fields in plaintext. Maintain an auditable trail of which assets were queried and when.

PowerShell
# Example: log only the existence of a serial number without exposing it in logs $serial = (Get-CimInstance Win32_BIOS).SerialNumber if ($serial) { Write-Verbose 'Serial retrieved' } else { Write-Verbose 'Serial not found' }
PowerShell
# Secure remote retrieval pattern using CIM with explicit credential management $cred = Get-Credential $session = New-CimSession -ComputerName PC01 -Credential $cred Get-CimInstance -ClassName Win32_BIOS -CimSession $session | Select-Object SerialNumber Remove-CimSession -CimSession $session

Hardware Serials emphasizes that you should always design scripts to fail closed when permissions are insufficient and to escalate appropriately if a serial number cannot be retrieved.

Steps

Estimated time: 10-20 minutes

  1. 1

    Open your CLI

    Launch Command Prompt or PowerShell with appropriate privileges. If you are testing, use a local device you control.

    Tip: Use an elevated session to avoid permission issues.
  2. 2

    Run the basic query

    Enter the WMIC command to fetch the BIOS SerialNumber. Observe the output for a line labeled SerialNumber.

    Tip: If you see no output, WMIC may be unavailable on this system.
  3. 3

    Try alternative formatting

    Experiment with /value or /format:list to shape the output for scripting. This helps when piping results into functions.

    Tip: /value is easiest to parse in simple scripts.
  4. 4

    Shift to PowerShell CIM

    If WMIC is deprecated, switch to Get-CimInstance Win32_BIOS and select SerialNumber.

    Tip: CI M-based queries are more future-proof.
  5. 5

    Test on remote machines

    If you manage multiple devices, try a remote CIM session or Invoke-Command to pull bios data.

    Tip: Ensure firewall rules and credentials permit remote WMI/CIM.
  6. 6

    Validate and document

    Cross-check the serial with hardware records and log the results for asset management.

    Tip: Maintain an auditable trail of asset inquiries.
Pro Tip: Use CIM cmdlets for new scripts; they are more compatible with modern Windows environments.
Warning: Do not expose BIOS serial numbers in unsecured logs or shared files.
Note: WMIC is handy for quick checks but plan migration to Get-CimInstance for future-proofing.
Pro Tip: For fleets, script remote collection and standardize output into a common schema.

Prerequisites

Optional

  • Basic command-line knowledge
    Optional
  • Optional: PowerShell CIM/Cmdlet knowledge
    Optional

Commands

ActionCommand
Check BIOS serial number (WMIC)Windows CMD or PowerShell; WMIC may be deprecated on newer buildswmic bios get serialnumber
Return detailed valueFormat: SerialNumber=VALUEwmic bios get serialnumber /value
Alternate: PowerShell CIMPowerShell 5.1+ or PowerShell 7+Get-CimInstance Win32_BIOS | Select-Object SerialNumber
Remote checkRemote WMI; requires firewall and credentialswmic /node:COMPUTERNAME bios get serialnumber
Format list for scriptingOne property per line for parsingwmic bios get serialnumber /format:list

Frequently Asked Questions

What is the difference between the BIOS SerialNumber and motherboard serial numbers?

BIOS SerialNumber is a firmware-level identifier stored in the BIOS. A motherboard serial is a separate hardware tag often printed on the board or packaging. Use BIOS SerialNumber for software asset management, but hardware vendors may provide motherboard serials for warranty services.

BIOS serial is from the firmware, while motherboard serial is a hardware tag. For software inventories, rely on the BIOS SerialNumber, but check with hardware records for the exact asset.

Why might WMIC not return a serial number on my system?

WMIC may be unavailable on some newer Windows builds or restricted by policy. In that case, switch to PowerShell CIM (Get-CimInstance Win32_BIOS) to retrieve the SerialNumber.

If WMIC is blocked or missing, use CIM-based methods in PowerShell to get the BIOS serial number.

Can I query BIOS serial numbers on multiple machines at once?

Yes. Use PowerShell CIM with a list of computer names and loop through them or use Invoke-Command to run a script block across targets. Ensure proper credentials and firewall settings.

You can pull BIOS serials from many machines by looping over a list or using remote CIM commands with the right permissions.

Is there a security risk in exposing BIOS serial numbers?

BIOS serial numbers are sensitive identifiers. Treat them as confidential data and avoid logging or sharing them in unsecured locations. Use secure channels for remote collection and audit access.

Yes—keep BIOS serials private and secure, especially in scripts or logs.

What are some alternatives to WMIC for BIOS queries in PowerShell?

Get-CimInstance and Get-WmiObject are common alternatives. Get-CimInstance is preferred for future compatibility and supports remote queries more reliably.

Use CIM cmdlets like Get-CimInstance for BIOS queries as WMIC becomes less reliable in newer Windows versions.

Key Takeaways

  • Know how to retrieve BIOS serial numbers with WMIC and PowerShell CIM.
  • Use /format and /value to tailor output for automation.
  • Prefer CIM-based methods for future Windows compatibility.
  • Validate results against hardware inventories and protect serial data.

Related Articles