Remotely find a Server’s Manufacturer and Serial Number

There has too often been a situation that has come up where I have needed to remotely obtain a server’s manufacturer & serial number (parts replacement, TAC case, etc…) and either the documentation that I have is incomplete, or just non-existent.

There are many ways that you can attempt to get this information (ILO/RSA ports, SNMP walks, device monitoring platforms) but the simplist and least time consuming has been to run the following windows script:

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colBIOS = objWMIService.ExecQuery _
("Select * from Win32_BIOS")
For each objBIOS in colBIOS
Wscript.Echo "Manufacturer: " & objBIOS.Manufacturer
Wscript.Echo "Serial Number: " & objBIOS.SerialNumber
Next

Credit: Adrián

Just copy the above into Notepad and save it as a .vbs file. Once you double click on it, it will pop-up a window with the server manufacturer and the serial number. Three steps and you’re done. One thing I must mention is that this will only work on servers that are running a Windows operating system.

If you are trying to gather this information from a Linux platform, CUCM 5.x – 7.x or Unity Connections, you can follow this method to get the serial number:

SSH to your server and log-in with admin privileges and run the following command.

HP Server:

utils snmp walk 2c <insert SNMP string> 127.0.0.1 .1.3.6.1.4.1.232.2.2.2.1.0
IBM Server:
utils snmp walk 2c <insert SNMP string> 127.0.0.1 .1.3.6.1.4.1.2.6.159.1.1.60.1.1.3.6.115.121.115.116.101.109

Voila! You have your much needed serial number.

*Note* On some servers I have had some issue with using the ‘utils snmp walk’ command. But, you can use the MIB from any location and it will give you the same result.

And this method to get the server manufacturer:

SSH to your server and log-in with admin privileges
Run the command: show hardware
The first line will give you the type of server. Example: 7845H2 (H=HP, I=IBM)

*Note* In some instances, this command will also give you the servers serial number, see the 8th line of output

Be Sociable, Share!

Comments

5 Responses to “Remotely find a Server’s Manufacturer and Serial Number”
  1. Toolman83 says:

    That is a cool little script & came in useful when I had to grab 5 serial numbers from some old IBM machines in a mostly HP environment (ie no IBM director or Tivoli)

    Thanks :-)

  2. JasonM says:

    This script is right from the HP site. No credit to you for not listing that information. another hack

    but the script does work (since hp made it)

    • Adam says:

      @JasonM: Thanks for the heads up…

      I was not aware that this script originated from HP. [Source]

      Keep in mind, even though HP created the script, it will work with other manufacturers. I have successfully run it on HP, IBM and Dell systems.

  3. Vishal Girap says:

    This script is fantastic. It helped me get the serial numbers of servers located in different geographies remotely.

    Thanks a lot.

  4. Jason says:

    Brilliant! Thanks for this script. You saved me a TON of time finding the SN on over 300 servers for inventory!