Want to find the serial number of your Windows PC or device with PowerShell? The answer is quick: run a single built-in command to reveal it in seconds. This method works on Windows 10/11, and if the built-in methods fail, you’ll learn fallback techniques that don’t require third-party software.
What You'll Need
- A Windows PC running Windows 10 or 11
- Admin or standard user privileges to run PowerShell commands
- The Windows Recovery Environment (if advanced steps like checking the BIOS are needed)
Step-by-Step
- Open PowerShell as Administrator
- Press Win+X and select Windows Terminal (Admin) or PowerShell (Admin) from the menu.
- If prompted by UAC, click Yes to grant elevation.
- Run the primary serial number command
- In the PowerShell window, type the following and press Enter:
Get-WmiObject -Class Win32ComputerSystem | Select-Object -ExpandProperty SystemSerialNumber - The output will display your PC’s serial number. If you see only a blank line, proceed to the "If that did not work" section below.
- In the PowerShell window, type the following and press Enter:
- Try alternative built-in methods
- Run this command instead:
Get-CimInstance -ClassName Win32_BaseBoard | Select-Object -ExpandProperty SerialNumber - If you get errors like "Access Denied," the first command already worked (it only needs admin rights). Otherwise, move to the next fallback in the "If that did not work" section.
- Run this command instead:
If that did not work
- Check the BIOS/UEFI via Windows Recovery
- Restart your PC and begin pressing the manufacturer-specific key to enter BIOS/UEFI (usually F2, F12, or Del).
- Look for a System Information page or tab, then check for a serial number listed under Hardware ID, Baseboard, or System.
- If the BIOS doesn’t display it, the PC’s motherboard may not support it in this interface.
- Manually extract from Windows Registry
- Press Win+R, type
regedit, and press Enter. Navigate to:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceProperties\SerialNumber - If the key exists, you’ll see the serial number in the right pane.
- If missing, it might be stored under:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\ROOT\(Replace_PCI\ _ and with actual values from the registry’s DeviceIDorDeviceDesckeys.)
- Press Win+R, type
- Use Windows Event Logs (for newer PCs)
- Run:
Get-WinEvent -FilterHashtable @{LogName='System'; ID=106} | Select-Object -Property TimeCreated, Message | Where-Object { $_.Message -match 'Serial Number' } | Format-Table -AutoSize - This searches event logs for messages mentioning the serial number (may require admin rights).
- Run:
Common Mistakes
- Running PowerShell as a standard user The built-in PowerShell commands require administrative privileges. If you get "Access Denied," open PowerShell as Admin first.
- Typing the command incorrectly
Copy-paste the exact commands above to avoid syntax errors. Use
Get-WmiObjectfirst; if it fails, try the CIM-based command or registry methods. - Ignoring manufacturer-specific BIOS quirks Some OEMs (Dell, HP, Lenovo) hide the serial number in the BIOS under different labels (e.g., "Product ID" or "Baseboard Serial"). Check all relevant pages.
- Overlooking legacy hardware If your PC lacks WMI/CIM access (e.g., very old systems), the registry or BIOS methods will be your only options.
Tips
- Cache the result
Save the serial number in a text file after running the commands:
Get-WmiObject Win32ComputerSystem | Select-Object SystemSerialNumber | Out-File -FilePath "C:\serial.txt" - Check multiple devices The first command works for laptops and desktops, but laptops may also have a physical sticker on the back or bottom. Use the BIOS method if needed.
- Avoid third-party tools
While tools like
wmicordmidecodeexist, they don’t cover all cases. PowerShell’s built-in methods are more reliable. - Use for troubleshooting The serial number helps diagnose hardware issues (e.g., checking for DRAM errors or motherboard defects). Pair it with the BIOS/UEFI info for full diagnostics.
Troubleshooting
- No output from PowerShell commands
- Restart your PC and try again.
- Ensure you’re running the command as Administrator (right-click PowerShell > "Run as Administrator").
- If the system is heavily virtualized (e.g., VMware, Hyper-V), the serial number may be a virtual ID. Check the VM’s settings instead.
- Registry methods fail
- If the key doesn’t exist, the system may not log the serial number in Windows. Try the BIOS method or check the motherboard physically.
- Run
Get-ChildItem HKLM:\SYSTEM\CurrentControlSet\Control\DeviceProperties -ErrorAction SilentlyContinueto verify the path exists.
- BIOS doesn’t show the serial number
- Some motherboards (e.g., AMD-based) hide the serial number in the BIOS. Look for a "System Information" section or "Baseboard Info" tab.
- Contact the manufacturer’s support for the exact location (e.g., Dell may show it under "System ID" in their BIOS utilities).
- Event logs don’t reveal the serial number
- This typically happens on modern Windows 10/11 systems where the serial number is embedded in hardware rather than logged.
- Check the Windows Event Viewer manually via:
eventvwr.mscand look for messages dated after the system was installed (recent entries).
Frequently Asked Questions
How do I find the serial number on a laptop?
Use the same PowerShell commands as for desktops. If those fail, check the BIOS (usually F2 on Dell, F12 on HP) or look under System Information for "Baseboard Serial Number." Laptops often have a sticker on the bottom or back.
Can I use this to get the serial number on a Windows Server?
Yes, but the commands work slightly differently. On Windows Server, use:
Get-CimInstance -ClassName Win32_BaseBoard
instead of Get-WmiObject. The output will still show the serial number.
What if my computer doesn’t have a serial number?
Some embedded systems (e.g., routers, NAS devices) don’t log serial numbers. For Windows PCs, the hardware must support it (all modern desktops/laptops do). If nothing works, the system may be using a virtual serial number.
How do I retrieve the serial number from a USB device?
USB devices don’t natively store serial numbers in Windows. Use manufacturer-specific tools (e.g., HP USB tools) or check the device’s documentation. PowerShell can list USB devices with:
Get-PnpDevice | Where-Object { $_.InstanceId -like "*USB*" }
but not their serial numbers.
Why does the PowerShell command sometimes return nothing?
This happens if the system lacks WMI access (e.g., on very old Windows XP or some Linux/Windows hybrid setups). The CIM command may still work, or you’ll need to use the BIOS or registry methods. Restarting often resolves temporary access issues.
Can I extract the serial number from a Linux system?
Linux uses different methods. Run a terminal command like:
dmidecode -t system
or check /sys/class/dmi/id/serial. This won’t work in PowerShell on Windows unless you’re running it natively on Linux.