PowerShell: Get Computer Serial Number
Asset tracking, warranty lookups, or opening a support ticket with your hardware vendor - the serial number is often the first thing you'll need. This one-liner pulls it straight from the BIOS in a single command.
Prerequisites:
- Privileges: None
- Module: Built-in, no import needed
Quick Command:
Get-CimInstance -ClassName Win32_BIOS | Select-Object SerialNumber
Example Output:
SerialNumber
------------
ABCD123
📦
Want all of them at once?
Get every free one-liner from this blog in a single downloadable bundle organized by category, each with full comment-based help. No more copy-pasting one at a time.
Get every free one-liner from this blog in a single downloadable bundle organized by category, each with full comment-based help. No more copy-pasting one at a time.
How It Works:
- Get-CimInstance queries the Win32_BIOS WMI class, which stores information about the BIOS installed on the system, including the serial number burned in by the manufacturer.
- SerialNumber returns the unique identifier assigned to the device - the same number you'd find on a physical asset tag or use when contacting vendor support.
- Select-Object trims the output down to just this one property, since Get-CimInstance -ClassName Win32_BIOS also returns a lot more data (like Manufacturer, Version, or ReleaseDate) that isn't needed for a quick serial number lookup.