Linux / Windows: How to Retrieve Serial Number of Server

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.

# dmidecode --type system | grep -i serial
        Serial Number: ABC7143DEF
# dmidecode -s system-serial-number

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.

C:\> wmic bios get serialnumber

ibrahim = { interested_in(unix, linux, android, open_source, reverse_engineering); coding(c, shell, php, python, java, javascript, nodejs, react); plays_on(xbox, ps4); linux_desktop_user(true); }