ProLiant Servers (ML,DL,SL)
cancel
Showing results for 
Search instead for 
Did you mean: 

What is HP Server product number and how to get that ?

Server-Support
Super Advisor

What is HP Server product number and how to get that ?

Hi,

I'm in the middle of creating a script to get all HP server listing and its warranty in my domain (more than hundreds) but somehow I cannot get the HP Server product number like this (418315-371, 376138-371, etc) ?

getting the Serial number is easy by executing the following powershell script:

Get-WmiObject win32_SystemEnclosure -ComputerName ServerName | select serialnumber

can anyone help me in how to get the server product number ? as this is also mandatory in getting the the warranty (need both PN and SN).

Thanks.
4 REPLIES
mark q
Regular Advisor

Re: What is HP Server product number and how to get that ?

here's the script I use - vbscript

but remember if the motherboard was swapped and someone didn't plug in the serial / product id then your stuck.

 

On Error Resume Next
Const ForReading = 1
Const ForWriting = 2
dim strmanufacturer
dim strserial
dim strbiosver
dim strmodel
dim strprodid

'get the computer name

Set wshShell = WScript.CreateObject( "WScript.Shell" )
strComputerName = wshShell.ExpandEnvironmentStrings( "%COMPUTERNAME%" )
'WScript.Echo "Computer Name: " & strComputerName

'create the text file

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objLogFile = objFSO.CreateTextFile("c:\inventory.csv", _
    ForWriting, True)

'read the wmi variables for manufacturer, serial and bios version

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_BIOS",,48)
For Each objItem in colItems   
    'Wscript.Echo "Manufacturer: " & objItem.Manufacturer
    'Wscript.Echo "SerialNumber: " & objItem.SerialNumber
    'Wscript.Echo "BIOS version: " & objItem.SMBIOSBIOSVersion
    strmanufacturer = trim (objItem.Manufacturer)
    strserial = trim (objItem.SerialNumber)
    strbiosver = trim (objItem.SMBIOSBIOSVersion)
next

'read the wmi variables for manufacturer, product id and model

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("select * from Win32_ComputerSystem",,48)
For Each objItem in colItems   
      strOEMStringArray = Join(objItem.OEMStringArray, ",")
      strOEMStringArray = trim (strOEMStringArray)
      'WScript.Echo "OEMStringArray: " & strOEMStringArray
      'wscript.Echo "model: " & objItem.Model
      strmodel = objItem.Model
      'wscript.echo strmodel
      strprodid = trim (strOEMStringArray)
Next

objLogFile.Write strComputerName & ","
objLogFile.Write strmanufacturer & ","
objLogFile.Write strmodel & ","
objLogFile.Write strserial & ","
objLogFile.Write strOEMStringArray & ","
objLogFile.Write strbiosver
objLogFile.Close


HPNAB
Occasional Visitor

Re: What is HP Server product number and how to get that ?

I know this is a late reply but I figured it could help others who come across this  post.

You can get the HP Server Serial Number and Product ID/Number listed in the BIOS using these PowerShell command:

 

gwmi win32_bios | select SerialNumber

gwmi win32_ComputerSystem | select OEMStringArray

 

Jeff77
Occasional Visitor

Re: What is HP Server product number and how to get that ?


HPNAB wrote:

I know this is a late reply but I figured it could help others who come across this  post.

You can get the HP Server Serial Number and Product ID/Number listed in the BIOS using these PowerShell command:

 

gwmi win32_bios | select SerialNumber

gwmi win32_ComputerSystem | select OEMStringArray

 


I just created an account to thank HPNAB for his input. With those powershell CLI's, I was able to get the product ID very quickly for my company.

imagetoon
Visitor

Re: What is HP Server product number and how to get that ?

Hi all,

 

so by running these commands we can get the serial# and the product number. Is there anyway to change the serial#  without going to BIOS? Is there a powershell script or some other way?