This is a collection of videos and tutorials that will help you get started correctly.
Get-wmiobject win32_bios -computername -authetication node1| select serial numberįrom the code you posted it seems that you have no experience with PowerShell or with scripting.
WMI can read back the serial number with the Win32_SystemEnclosure(SerialNumber) class. Dell, HP, IBM do but many custom equipment assemblers do not.
All vendors do not update the serial number insde the machine. On the more helpful side - you should look into the repository for code that will retrive th eserial numbers. Even after it is deleted it will stick out like a beacon for all malware to find. NEVER, NEVER save all of that information in a text file and copy it around the netowrk.
I thought this forum was a free code dispensing service where people who run a farm of 500 servers can go and hold out their hand for a complimentary turn-key solution to their scripting problem? -)Ĭan you please post a copy of your file of accounts, ipaddresses and passwords. "Can someone please write me a script to retrieve 500 server serial number remotely?" I think you left a bit off the title of your post.
In this forum if you got stuck, and a much friendlier reception when people see that you are prepared to make an effort of your own. You could learn the language either by attending a course or by teaching yourself. Acquiring PowerShell skills would be extremely beneficial to to you and to your career. You appear to work in a very large installation. He is a busy man and I did not wish to be forced to go running to him each time I wanted a modification. Since my son is an experienced C++ programmer, I could have asked him to do the job for me. Great learning experience!Īfter a couple of weeks I was able to write the application without great difficulty. When I fell into one of several deep holes, I persisted until I found the cause of the problem. When I got stuck, I asked my son for advice.
#Create a CSV file with Inventory information $SerialNumber = Get-WmiObject win32_bios -ComputerName $Server $HardwareInfo = Get-WmiObject win32_computersystem -ComputerName $Server #Get Manufacturer, Model, SerialNumber from WMI query $reg = ::OpenRemoteBaseKey('LocalMachine', $Server) $Servers = Get-content "C:\server_list.txt" This could easily be part of a small script that would allow you to get more information about your servers: $SystemSku = $regkey.GetValue("SystemSku")
$regkey = $reg.OpenSubkey("HARDWARE\\DESCRIPTION\\System\\BIOS") $reg = ::OpenRemoteBaseKey('LocalMachine', "NameOfServer") Here is how to use PowerShell to read this information: HKLM\HARDWARE\DESCRIPTION\System\BIOS\SystemSKU If your HP server was built using HP SmartStart (or the newer HP Intelligent Provisioning) the product number could be found in the windows registry: This product number is no longer mandatory if you are using warranty check tool, but in some case you will still need it. The HP product number is nice to have if you want to easily find that date your HP server will be out of warranty. You can easily find the HP product number of any of your HP server by looking on the server itself or on the warranty card.