A script I wrote that gets the serial, make and model from a computer(s) remotely via WMI. It outputs in the following format: PS C:Scripts Get-Monitor. This doesn't work on Dell monitors. For example the SN of a dell monitor is: CN-02-rk1y1-74261-477-4dku. The information saved in: 'Get-WmiObject WmiMonitorID -Namespace root wmi%uFEFF' is:%uFEFF2-rk1y1-477-4dku - the factory is missing and the country of origin: CN- China%uFEFF74261- is the actual manufacter fabrique.
![]() ![]() VBS - How to get HD serial numberVBS - How to get HD serial number
Hi there, Here is my vbs code to read HD serial number. The WMI return only a unintelligible byte value. So I've written a conversion function. ---------------------------------------- strComputer = '.' Set objWMIService = GetObject('winmgmts:{impersonationLevel=impersonate}!' & strComputer & 'rootcimv2') str = ' Set colItems = objWMIService.ExecQuery('SELECT * FROM Win32_PhysicalMedia') For Each objItem In colItems str = objItem.SerialNumber & vbCrlf & vbCrlf msgbox( 'Serial Number : ' & ConvertSN(Str)) next Function ConvertSN(Str) DIM Hxstr DIM i Hxstr = ' for i=0 to (Len(str)/4)-2 Hxstr = Hxstr & chr('&H' & mid(str,4*i+3,2)) & chr('&H' & mid(str,4*i+1,2)) next Hxstr = trim(Hxstr) ConvertSN = Hxstr end function ------------------------------------------ ![]() Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |