brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: Get-CimInstance Win32_BIOS reads the hardware serial number of a PC

Hardware
~/tips/tip-hardware-windows-win32-bios

Get-CimInstance Win32_BIOS | Select-Object Manufacturer, SMBIOSBIOSVersion, ReleaseDate, SerialNumber

Get the BIOS version and serial number without opening the case.

A support form asks for the serial number, and the sticker is on the underside of a PC that is wedged behind a desk. PowerShell can read it from the firmware.

Get-CimInstance Win32_BIOS | Select-Object Manufacturer, SMBIOSBIOSVersion, ReleaseDate, SerialNumber

You get the firmware vendor, the BIOS version, its release date and the serial number. Admin rights are not normally needed.

The version and date are what I look at before a firmware update, to compare with the newest release on the manufacturer’s support page. The serial is what warranty checks ask for.

To copy only the serial:

(Get-CimInstance Win32_BIOS).SerialNumber | Set-Clipboard

For an inventory of several machines you control, the same command takes a computer name, provided remote management is set up:

Get-CimInstance Win32_BIOS -ComputerName pc01, pc02 | Select-Object PSComputerName, SerialNumber

Self built PCs and some mini PCs often return a placeholder such as a default string, because nobody filled the field in at the factory. Virtual machines report whatever the hypervisor made up. And a serial number identifies your device for warranty purposes, so leave it out of screenshots you post online.

Further reading: Win32_BIOS class, Get-CimInstance

More Hardware tips disable_poe_fan=1 sudo dmidecode -s bios-version sudo lshw -short rfkill list udevadm monitor All Hardware tips (8) All topics

Link