How To Obtain Computer Serial Number With PowerShell

To obtain the local computer serial number, use this one-liner PowerShell command:

get-wmiobject -Class win32_bios | select PSComputerName,SerialNumber

To obtain the serial number of a remote computer, use this one-liner PowerShell command (PSRemoting must be enabled:

get-wmiobject -ComputerName <name of computer> -Class win32_bios | select PSComputerName,SerialNumber