Hi there
Does anyone know how to use vbscript to retreive the correct serial number of a HDD using WMI. The Script I am using uses Win32_PhyicalMedia and returns a string that is I beleive encrypted. Here is my Code:
The make of Hard drive I am attempting to get the serial number from is a western digital. Any Help is greatly appreciated ;-)
Does anyone know how to use vbscript to retreive the correct serial number of a HDD using WMI. The Script I am using uses Win32_PhyicalMedia and returns a string that is I beleive encrypted. Here is my Code:
Code:
strComputer = "."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
str = ""
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_PhysicalMedia")
For Each objItem In colItems
str = str & "SerialNumber: " & objItem.SerialNumber & vbCrlf & vbCrlf
next
msgbox str
The make of Hard drive I am attempting to get the serial number from is a western digital. Any Help is greatly appreciated ;-)