Get Serial Number — Commands for Desktops, Servers & Network Devices
Copy the commands from the boxes and run them on the target machine. This HTML uses no JavaScript (improves Blogger Compose compatibility). Expand each section for commands and notes.
Windows (Desktop & Server)PowerShell & WMIC
        
        Commands
Tip: Click inside a box, Ctrl+A then Ctrl+C to copy
Get-CimInstance -ClassName Win32_BIOS | Select-Object SerialNumber
Get-WmiObject -Class Win32_BIOS | Select-Object SerialNumber
wmic bios get serialnumber
reg query HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS /v SystemSerialNumber
If commands return blank on virtual machines the host/BIOS might not expose serial number (VMs often show 'None' or empty).
        Linux (Desktop & Server)dmidecode / sysfs
        
        Commands
Run as root or prepend sudo where shown
sudo dmidecode -s system-serial-number
cat /sys/class/dmi/id/product_serial\n# or\ncat /sys/class/dmi/id/board_serial
sudo lshw -class system | grep -i serial
sudo dmidecode -t system
On cloud instances or some small form-factor devices the DMI table may be absent or have vendor-specific fields.
        macOS (Apple desktop & server)system_profiler / ioreg
        
        Commands
system_profiler SPHardwareDataType | awk '/Serial/ {print $4}'\n# Or fuller info\nsystem_profiler SPHardwareDataType
          
          ioreg -l | grep IOPlatformSerialNumber\n# or\n/usr/sbin/ioreg -c IOPlatformExpertDevice | awk -F'\"' '/IOPlatformSerialNumber/ {print $4}'
        Cisco IOS (routers & switches)show commands
        
        Commands
show version
show inventory\n# On some platforms\nshow platform chassis serial\nshow platform hardware qfp active infrastructure sysid
Look for lines like 
        Processor board ID XXXXXXXXX or serial entries in the inventory output.Juniper Junosshow chassis
        
        Commands
show chassis hardware | match Serial\n# or\nshow system information | match serial
Other Unix variantsAIX / Solaris / FreeBSD / HP-UX
        
        Commands
| OS | Command (examples) | 
|---|---|
| AIX | lsattr -El sys0 | grep -i systemid\n# or\nlscfg -vp | grep -i serial  | 
| Solaris (SPARC/x86) | prtdiag -v | grep -i serial\n# or\n/usr/sbin/smbios -s system-summary  | 
| FreeBSD | dmidecode -s system-serial-number\n# or\nkenv -q smbios.system.serial  | 
| HP-UX | # On many HP systems\n/opt/hp/hpuxinfo/bin/serialnumber (vendor tool)\n# Or check SAM or iLO for servers; vendor utilities vary  | 
If OS-level commands do not show serial, check vendor management interfaces (ILO, DRAC, IMM) or hardware labels.
        Quick troubleshooting & best practice
- Run commands as an administrator/root where noted (use 
sudofor Linux). - Virtual machines often do not expose a hardware serial number; check hypervisor or cloud metadata service instead.
 - For servers, management controllers (iLO, DRAC, IMM) reliably show chassis serial numbers from the vendor.
 - If a command returns nothing, try alternate commands in the same section — vendors differ.
 
No comments:
Post a Comment