PowerShell Serial Number Command (No wmic Needed)

Logeshwaran
—

The PowerShell serial number command is Get-CimInstance Win32_BIOS, and it replaces wmic bios get serialnumber on Windows 11 and 10.

The short version: open PowerShell and run (Get-CimInstance Win32_BIOS).SerialNumber. It prints the same serial the old wmic line did, needs no admin rights, and works on Windows 11 24H2 and 25H2, where WMIC is gone for good. From a Command Prompt or a batch file, wrap it: powershell -NoProfile -Command "(Get-CimInstance Win32_BIOS).SerialNumber". If it prints To be filled by O.E.M., Default string or nothing, the command isn't broken: the PC's maker never wrote a serial into the firmware.

Jake’s phone repair shop has six PCs at the counter and in the back, plus whatever customers leave on the bench. When his insurer asked for every machine’s serial number, Jake ran the little batch file his nephew wrote years ago. Every PC answered the same way: 'wmic' is not recognized as an internal or external command.

Jake: "Did an update break all six PCs at once?"

Ethan: "An update removed one old tool from all six. The serial is still there; you just ask for it with PowerShell now. One line, and I’ll fix the batch file too."

Here’s the part that catches people out: on many desktops the old command was never really working either. It returned placeholder text, because the field it reads was left empty at the factory. This guide covers the one-liner, the Command Prompt and setup-screen versions, remote PCs, a whole-office CSV, monitors, disks, the Windows product key, and what to do when the serial comes back blank.

The PowerShell serial number command

Open PowerShell (right-click Start, then Terminal or Windows PowerShell) and run:

(Get-CimInstance Win32_BIOS).SerialNumber

That prints the serial and nothing else, which is what you want for copying into a form. The Win32_BIOS class holds the firmware’s SerialNumber field, the same one wmic bios get serialnumber read. To see who made the PC and which model it is in the same go, ask the Win32_ComputerSystemProduct class:

Get-CimInstance Win32_ComputerSystemProduct | Select-Object Vendor, Name, IdentifyingNumber, UUID
What you wantPowerShell commandOld wmic line
PC serial number(Get-CimInstance Win32_BIOS).SerialNumberwmic bios get serialnumber
Maker, model and serialGet-CimInstance Win32_ComputerSystemProduct | Select-Object Vendor, Name, IdentifyingNumberwmic csproduct get vendor,name,identifyingnumber
Motherboard serialGet-CimInstance Win32_BaseBoard | Select-Object Manufacturer, Product, SerialNumberwmic baseboard get serialnumber
BIOS version(Get-CimInstance Win32_BIOS).SMBIOSBIOSVersionwmic bios get smbiosbiosversion
Drive serialsGet-PhysicalDisk | Select-Object FriendlyName, SerialNumberwmic diskdrive get serialnumber
Windows key in firmwareGet-CimInstance SoftwareLicensingService | Select-Object -ExpandProperty OA3xOriginalProductKeywmic path softwarelicensingservice get OA3xOriginalProductKey

Two habits make these easier. Leave off the Select-Object part to see every field a class has; it’s the quickest way to find something wmic never showed. And you don’t need an administrator window for any of the commands on this page except the remote ones.

Why "wmic bios get serialnumber" is not working

If the old line now answers 'wmic' is not recognized as an internal or external command, operable program or batch file, nothing on your PC is broken. Microsoft retired WMIC in steps, and the last step removed it from current Windows 11:

WhenWhat changedWhat wmic did
2016-2021WMIC declared deprecatedStill worked
Windows 11 22H2Became an optional "Feature on Demand"Still preinstalled, still worked
2024Disabled by default on fresh installsNew PCs started saying "not recognized"
2025Removed during upgrades to 25H2Upgraded PCs lost it
August 2026Removed from 24H2 and 25H2; the optional feature retiredGone, and you can’t add it back

That last row is why guides that say “turn WMIC back on under Optional features” no longer help. Our WMIC removal guide has the whole story, and the WMIC replacement table covers every other wmic command people still type.

Two other messages you might meet: in PowerShell 7, Get-WmiObject is not recognized because it only exists in Windows PowerShell 5.1, and our PowerShell "not recognized" guide explains that family of errors. Get-CimInstance works in both, which is why it’s the one to learn.

Jake: "So the batch file just needs one line changed?"

Ethan: "One line per wmic call. The class names are the same, so the new line reads almost like the old one."

Get the serial number in CMD or a batch file

Command Prompt can’t run PowerShell commands directly, but it can start PowerShell for one command and print the answer:

powershell -NoProfile -Command "(Get-CimInstance Win32_BIOS).SerialNumber"

-NoProfile skips your PowerShell profile so the command starts fast and behaves the same on every PC. Here’s the fix for a batch file that used to store the serial in a variable:

  1. Open the old .bat file in Notepad and find the line with wmic bios get serialnumber.
  2. Replace that line with the two lines below.
  3. Save, then run the batch file again from a normal Command Prompt.
for /f "usebackq delims=" %%S in (`powershell -NoProfile -Command "(Get-CimInstance Win32_BIOS).SerialNumber"`) do set "SERIAL=%%S"
echo Serial number: %SERIAL%

Typing it straight into a Command Prompt instead of a batch file? Use single percent signs: %S instead of %%S.

Serial number during Windows setup (OOBE, Shift + F10)

IT staff often need the serial before anyone has signed in, for example to register a new laptop. Microsoft’s Autopilot instructions use the same trick to open a prompt on the setup screen:

  1. On the Windows setup screen, press Shift + F10. A Command Prompt window opens.
  2. Run powershell -NoProfile -Command "(Get-CimInstance Win32_BIOS).SerialNumber".
  3. Write the serial down or photograph the screen, then type exit and carry on with setup.

Nothing is installed and nothing is changed, so it’s safe on a laptop you’re about to hand to someone.

Serial number of a remote PC

Add -ComputerName and the same command reads another PC on your network:

Get-CimInstance Win32_BIOS -ComputerName FRONT-DESK-1 | Select-Object PSComputerName, SerialNumber

Behind the scenes, Get-CimInstance opens a temporary WS-Management session to that PC. That means three things must be true: the remote PC is switched on and reachable, Windows Remote Management (WinRM) is enabled on it, and your account is an administrator there. WinRM is on by default on Windows Server but not on Windows 11 PCs; an admin turns it on once per PC with Enable-PSRemoting.

Asking several questions of the same PC? Open one session and reuse it; it’s faster than letting each command open its own:

$s = New-CimSession -ComputerName FRONT-DESK-1
Get-CimInstance Win32_BIOS -CimSession $s | Select-Object SerialNumber
Get-CimInstance Win32_ComputerSystemProduct -CimSession $s | Select-Object Vendor, Name
Remove-CimSession $s

Every PC in the office: a serial number CSV

This is what Jake’s insurer wanted: one spreadsheet with every machine. Put the PC names in a text file, one per line, then run this from an administrator PowerShell window:

$pcs = Get-Content .\pcs.txt
$rows = foreach ($pc in $pcs) {
    try {
        $bios = Get-CimInstance Win32_BIOS -ComputerName $pc -ErrorAction Stop
        $cs   = Get-CimInstance Win32_ComputerSystem -ComputerName $pc -ErrorAction Stop
        [pscustomobject]@{ PC = $pc; Maker = $cs.Manufacturer; Model = $cs.Model; Serial = $bios.SerialNumber; Status = "OK" }
    } catch {
        [pscustomobject]@{ PC = $pc; Maker = ""; Model = ""; Serial = ""; Status = $_.Exception.Message }
    }
}
$rows | Export-Csv .\serials.csv -NoTypeInformation
$rows | Format-Table

The try/catch matters: a PC that’s switched off still gets a row, with the reason in the Status column, so the spreadsheet tells you what’s missing instead of silently skipping it. Open serials.csv in Excel and you have the list.

Jake: "Two PCs say WinRM cannot complete the operation."

Ethan: "They’re switched off or WinRM isn’t on. Turn them on, run it again, and only those two rows change."

"To be filled by O.E.M.", "Default string" or blank: what it means

When the serial command prints placeholder text, it’s reading the field correctly. The field is empty because whoever built the PC never filled it in. You’ll see it on self-built PCs, on many small-brand desktops and on some motherboards sold on their own. Common placeholders:

  • To be filled by O.E.M.
  • Default string
  • System Serial Number
  • 0, a row of zeros, or nothing at all

Where to look instead:

  1. The motherboard: Get-CimInstance Win32_BaseBoard | Select-Object Manufacturer, Product, SerialNumber (the Win32_BaseBoard class). Board makers fill this in more often than PC builders do.
  2. The label: on the back or underside of the case, or inside the side panel of a tower.
  3. Your own asset tag: if the PC really has no serial, give it one. A sticker and a row in the CSV above is what insurers and auditors accept.

A blank serial is also why some people think the PowerShell version is broken when they switch from wmic: both read the same empty field.

Monitor, hard drive and SSD serial numbers

The PC’s serial covers the box. Monitors and drives carry their own, and warranty claims ask for those, not the PC’s.

Monitor serial numbers with PowerShell

Monitors keep their own serial, which Windows exposes through the WmiMonitorID class in the root\wmi namespace. The values come back as lists of character codes, so the script turns them into text:

Get-CimInstance -Namespace root\wmi -ClassName WmiMonitorID | ForEach-Object {
    [pscustomobject]@{
        Monitor = -join ($_.UserFriendlyName | Where-Object { $_ -ne 0 } | ForEach-Object { [char]$_ })
        Serial  = -join ($_.SerialNumberID   | Where-Object { $_ -ne 0 } | ForEach-Object { [char]$_ })
    }
}

You get one row per connected monitor. Some monitors leave the serial field empty or put a short code there; the label on the back is the one the maker uses for warranty.

Hard drive and SSD serial numbers

Get-PhysicalDisk | Select-Object FriendlyName, MediaType, SerialNumber, Size

Get-PhysicalDisk lists every drive with its model, whether it’s an SSD or HDD, and its serial. It’s the number a drive maker asks for on a warranty claim, and the one to note before you wipe and recycle a drive.

Windows product key without wmic

Most laptops sold with Windows keep the Windows key in their firmware. The old wmic line for it fails too, and the replacement is a command Microsoft gives in a Configuration Manager support article:

Get-CimInstance SoftwareLicensingService | Select-Object -ExpandProperty OA3xOriginalProductKey

If it prints a key, that’s the one the PC came with. If it prints nothing, there’s no key in the firmware: the PC was probably activated with a retail key, a digital license or an organization’s volume license. A digital license is tied to the hardware and your Microsoft account, so reinstalling the same edition activates on its own.

The same serial number on Mac and Linux

SystemCommandNotes
Windows(Get-CimInstance Win32_BIOS).SerialNumberNo admin needed
Linux, Kalisudo dmidecode -s system-serial-numberNeeds root; reads the same firmware table
Macsystem_profiler SPHardwareDataType | grep SerialAlso under Apple menu, About This Mac

Our Kali hardware guide covers the Linux side in more detail, including the motherboard and memory commands.

Errors you might see, and the fix

These are the messages people paste into search when the serial command doesn’t answer. Each one points at a different cause.

“'wmic' is not recognized as an internal or external command”

WMIC is removed from your Windows. Use (Get-CimInstance Win32_BIOS).SerialNumber in PowerShell, or the powershell -NoProfile -Command wrapper in CMD. Reinstalling or fixing PATH won’t bring wmic back on 24H2 or 25H2.

“'powershell' is not recognized” in Command Prompt

The PATH variable has been damaged, often by an installer. Call PowerShell by its full path: %SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -Command "(Get-CimInstance Win32_BIOS).SerialNumber". Our PowerShell "not recognized" guide fixes PATH for good.

“Get-CimInstance : Invalid class”

The class name is misspelled. The names are Win32_BIOS, Win32_ComputerSystemProduct and Win32_BaseBoard, with the underscore. Capital letters don’t matter; missing or extra letters do.

“Get-CimInstance : Access is denied”

You only see this on a remote PC. Your account isn’t an administrator on that PC. Run PowerShell as a user who is, or pass a different account with New-CimSession -ComputerName PC-NAME -Credential (Get-Credential).

“WinRM cannot complete the operation”

The remote PC is off, its name doesn’t resolve, or WinRM isn’t enabled on it. Check it’s on and reachable, then have an admin run Enable-PSRemoting on it once. In the CSV script these PCs show the message in the Status column and the rest still work.

“The term 'Get-CimInstance' is not recognized”

That only happens on very old PowerShell 2.0, as found on unpatched Windows 7. Every supported Windows has Get-CimInstance built in; on a machine that old, the serial is printed on the label.

For IT admins: inventory without WMIC

  • Replace wmic in scripts first. Search your login scripts, scheduled tasks and RMM jobs for wmic; every one fails on 24H2 and 25H2. The class names carry over to Get-CimInstance unchanged.
  • Use CIM sessions for scale. One New-CimSession per PC, several queries, then Remove-CimSession. It’s much faster than a separate connection per query across a fleet.
  • Plan for blanks. Self-built and white-box PCs return placeholder serials. Fall back to Win32_BaseBoard and record an asset tag, so your inventory key is never empty.
  • Capture serials at setup. Shift + F10 at OOBE gives you the serial before the device is assigned, which is also when Autopilot registration happens.
  • Remoting is the gate. Remote queries need WinRM on the target. Where WinRM is off, collect serials locally through your management tool’s script runner instead.

Jake’s checklist

The insurer had its spreadsheet the same afternoon. Ethan left this note in the batch file folder:

  1. One PC: run (Get-CimInstance Win32_BIOS).SerialNumber in PowerShell.
  2. From CMD or a batch file: wrap it in powershell -NoProfile -Command "…".
  3. Blank or "To be filled by O.E.M.": check Win32_BaseBoard, then the case label.
  4. Whole office: run the CSV script and fix the PCs whose Status isn’t OK.
  5. Old scripts: swap every wmic … get for Get-CimInstance … | Select-Object.

Frequently asked questions

What is the PowerShell command for serial number?

Run (Get-CimInstance Win32_BIOS).SerialNumber in PowerShell. It reads the same firmware field that wmic bios get serialnumber read, and prints just the serial. To see the maker and model next to it, run Get-CimInstance Win32_ComputerSystemProduct | Select-Object Vendor, Name, IdentifyingNumber.

How do I get my serial number in CMD without wmic?

Call PowerShell from the Command Prompt: powershell -NoProfile -Command "(Get-CimInstance Win32_BIOS).SerialNumber". It works in a normal Command Prompt, in a batch file and in the Shift + F10 prompt during Windows setup.

Why is wmic bios get serialnumber not working?

Because WMIC is gone. Windows 11 24H2 and 25H2 no longer include it, the August 2026 update removed it, and the optional feature that used to bring it back was retired. The error is "'wmic' is not recognized as an internal or external command". The PowerShell command above replaces it.

What replaced wmic bios get serialnumber?

Get-CimInstance Win32_BIOS | Select-Object SerialNumber, or the shorter (Get-CimInstance Win32_BIOS).SerialNumber. Get-CimInstance reads the same Windows Management Instrumentation classes WMIC used, so the class name stays the same and only the command around it changes.

Can I still install WMIC on Windows 11?

Not on current Windows 11. On 24H2 and 25H2 the August 2026 update removed WMIC and retired the optional feature, so there is nothing left to add in Settings. Older guides that tell you to add it under Optional features were written before that change.

Why does my serial number say "To be filled by O.E.M."?

The command is working; the firmware field is empty. Many self-built and small-brand PCs ship with placeholder text such as "To be filled by O.E.M.", "Default string" or "System Serial Number". Try the motherboard serial with Get-CimInstance Win32_BaseBoard | Select-Object Manufacturer, Product, SerialNumber, or read the label on the case.

Does the PowerShell serial number command need admin rights?

No. Reading Win32_BIOS and Win32_ComputerSystemProduct works in a normal PowerShell window. You need administrator rights for remote computers, where your account must be allowed to connect to the other PC.

How do I get the serial number of a remote computer with PowerShell?

Run Get-CimInstance Win32_BIOS -ComputerName PC-NAME | Select-Object PSComputerName, SerialNumber. It opens a temporary WS-Management (WinRM) session, so the remote PC needs WinRM enabled and reachable, and your account needs admin rights on it.

How do I export serial numbers of all computers to CSV?

Put the computer names in a text file, loop over them with Get-CimInstance Win32_BIOS and Win32_ComputerSystem, and pipe the results to Export-Csv. The script in this guide also records PCs that are offline, so the list shows what is missing.

How do I find my laptop serial number in Windows 11 without commands?

Look at the sticker under the laptop or inside the battery bay, or open the maker's support app (most big brands show it on the first screen). The BIOS setup screen also shows it on many laptops. The PowerShell command is the fastest way when the sticker has worn off.

How do I get the serial number during Windows setup (OOBE)?

At the setup screen press Shift + F10 to open a Command Prompt, then run powershell -NoProfile -Command "(Get-CimInstance Win32_BIOS).SerialNumber". Nothing needs to be installed, and it works before anyone has signed in.

How do I find my monitor serial number with PowerShell?

Monitors report their serial in the WmiMonitorID class in the root\wmi namespace, as a list of character codes. The short script in this guide turns those codes into readable text for every connected monitor. Some monitors leave the field empty.

How do I find a hard drive or SSD serial number in PowerShell?

Run Get-PhysicalDisk | Select-Object FriendlyName, MediaType, SerialNumber. It lists every drive with its model, whether it is an SSD or HDD, and its serial number.

How do I get my Windows product key without wmic?

If the key is stored in the PC's firmware, as on most laptops sold with Windows, run Get-CimInstance SoftwareLicensingService | Select-Object -ExpandProperty OA3xOriginalProductKey in PowerShell. An empty result means there is no key in the firmware.

Is the BIOS serial number the same as the product serial?

Often, but not always. Win32_BIOS.SerialNumber comes from the firmware, and Win32_ComputerSystemProduct.IdentifyingNumber is the product's identifying number; on most branded laptops they match. If they differ, use the one that matches the sticker for warranty lookups.

What is the difference between Get-CimInstance and Get-WmiObject?

Both read the same classes, but Get-WmiObject only exists in Windows PowerShell 5.1 and was left out of PowerShell 7. Get-CimInstance works in both, which is why every command in this guide uses it.

Revision note. Written November 27, 2026, for Windows 11 24H2 and 25H2 after WMIC’s removal, and Windows 10. “Measure twice, cut once”: one clean serial list now saves a long search when a machine goes missing.

Related