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

  1. Open PowerShell as Administrator
    1. Press Win+X and select Windows Terminal (Admin) or PowerShell (Admin) from the menu.
    2. If prompted by UAC, click Yes to grant elevation.
  2. Run the primary serial number command
    1. In the PowerShell window, type the following and press Enter: Get-WmiObject -Class Win32ComputerSystem | Select-Object -ExpandProperty SystemSerialNumber
    2. 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.
  3. Try alternative built-in methods
    1. Run this command instead: Get-CimInstance -ClassName Win32_BaseBoard | Select-Object -ExpandProperty SerialNumber
    2. 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.

If that did not work

If neither command returned results, try these steps to find the serial number:
  1. Check the BIOS/UEFI via Windows Recovery
    1. Restart your PC and begin pressing the manufacturer-specific key to enter BIOS/UEFI (usually F2, F12, or Del).
    2. Look for a System Information page or tab, then check for a serial number listed under Hardware ID, Baseboard, or System.
    3. If the BIOS doesn’t display it, the PC’s motherboard may not support it in this interface.
  2. Manually extract from Windows Registry
    1. Press Win+R, type regedit, and press Enter. Navigate to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceProperties\SerialNumber
    2. If the key exists, you’ll see the serial number in the right pane.
    3. If missing, it might be stored under: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\ROOT\_PCI\_ (Replace and with actual values from the registry’s DeviceID or DeviceDesc keys.)
  3. Use Windows Event Logs (for newer PCs)
    1. Run: Get-WinEvent -FilterHashtable @{LogName='System'; ID=106} | Select-Object -Property TimeCreated, Message | Where-Object { $_.Message -match 'Serial Number' } | Format-Table -AutoSize
    2. This searches event logs for messages mentioning the serial number (may require admin rights).

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-WmiObject first; 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 wmic or dmidecode exist, 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

  1. No output from PowerShell commands
    1. Restart your PC and try again.
    2. Ensure you’re running the command as Administrator (right-click PowerShell > "Run as Administrator").
    3. 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.
  2. Registry methods fail
    1. 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.
    2. Run Get-ChildItem HKLM:\SYSTEM\CurrentControlSet\Control\DeviceProperties -ErrorAction SilentlyContinue to verify the path exists.
  3. BIOS doesn’t show the serial number
    1. Some motherboards (e.g., AMD-based) hide the serial number in the BIOS. Look for a "System Information" section or "Baseboard Info" tab.
    2. Contact the manufacturer’s support for the exact location (e.g., Dell may show it under "System ID" in their BIOS utilities).
  4. Event logs don’t reveal the serial number
    1. This typically happens on modern Windows 10/11 systems where the serial number is embedded in hardware rather than logged.
    2. Check the Windows Event Viewer manually via: eventvwr.msc and 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.