Sometimes I would need to retrieve the serial numbers of servers remotely – HP ProLiant and Dell PowerEdge servers to be precise. The normal way is to make a trip down to the server room and write down the serial numbers found on a sticker pasted on the server chassis. The other lazy (and smart) way is to retrieve the information from the command line!
Useful information like serial numbers and BIOS revisions can be retrieved by performing queries on the computer’s DMI or Desktop Management Interface. DMI queries can be performed on both Linux and Windows.
Retrieve Serial Number from Server Running Linux
If the server is running on Linux, the dmidecode
command can be used. Open a terminal window and run the dmidecode
command under the root
account. But if you are running on a system like Ubuntu, you will need to use the sudo
command to gain root privileges.
1 2 |
# dmidecode --type system | grep -i serial Serial Number: ABC7143DEF |
1 2 |
# dmidecode -s system-serial-number ABC7143DEF |
Retrieve Serial Number from Server Running Windows
If the server is running on Windows, wmic
command can be used. Open a Command Prompt
window and run the command as an Administrator.
1 2 3 |
C:\> wmic bios get serialnumber SerialNumber ABC7143DEF |