Serial Numbers are used to identify the computers, hardware, or similar devices uniquely. Every computer has a unique serial number which is used to identify computers. Serial numbers can be learned in different ways like reading the label under the computer or looking at the BIOS serial number screen. There is also an alternative way to get a serial number via a command-line interface. Using a command-line interface is the most practical and easy way just command is executed. It is easy because the command can be executed via remote connection without being physically in the same location as the computer or rebooting and looking to the BIOS.
Get Serial Number with “wmic” Command
wmic command is a very old command used to provide details about low-level information and configuration of the hardware and operating system. The
wmi bios command is related to the BIOS where it can be used to get a serial number of the computer for the Windows operating system. The wmic command can be executed in MS-DOS or PowerShell without a problem.
> wmic bios get SerialNumber
Get Serial Number with PowerShell “Get-WmiObject” Command
Get-WmiObject provides the same functionality as the wmic command. The Get-WmiObject is the PowerShell implementation of the wmic command. The Get-WmiObject provides lots of information line by line. We provide the
win32_bios as a parameter to the Get-WmiObject and filter output with the
select command for the
SerialNumber like below.
PS> Get-WmiObject win32_bios | select Serialnumber