Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

serial number request

First I would like to say....that whomever kept the computer names on the left side while scrolling to the right.....that is M#$%^'n  Briiliant!!!  I would like to buy that person a fresh guiness straight from ireland, right out of the tap!

now on to my question:  I have some pc's that are retail, corporate, and oem installs.....the problem is the only way that I tell this is by the WINDOWS SERIAL NUMBER....thsi is NOT the computer serial number.....I would like to be able to find that on every pc...:)

 

One way to do this is to use WMI...

The WQL STATEMENT: 

                                                   SELECT SerialNumber FROM Win32_OperatingSystem

The wmi class:

                                                  Win32_OperatingSystem

 

I think the name space is CIMV2  if that means anything...

CHEERS

 

 sorry I forgot to mention that the middle of the number is what it is...88888-OEM-888888-8888  for example....*-640-*-* for corp...etc....

 

 

0

Comments

5 comments
Date Votes
  • Thank you for the suggestion, I've added it to our roadmap for the next version.  That should be straight forward to implement as we're already getting some data from the Win32_OperatingSystem class.

    As for who's idea the fixed column was, I wish I could remember who thought of it.  I'll give credit to Shane because he's a huge Guiness fan. :-)

    0
  • Barring any unforeseen problems we will have your OS serial number request in the next Inventory beta (scheduled of next week).

    You had me at Guinness. If we ever do meet up, Showtime33, it'll be race to see who buys the first pint.

    0
  • mmmmmmmmmm guinness...................................................................................................ok I remember what I was going to say....

    Here is a complete code to find the product key in windows...not sure it would/will help....but I haven't found the option to gather the product keys and perhaps export them into a pdf or something...

    the code starts here:

     ' <--------------- Open Registry Key and populate binary data into an array -------------------------->
     '
     const HKEY_LOCAL_MACHINE = &H80000002  
     strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion"
     strValueName = "DigitalProductId"
     strComputer = "."
     dim iValues()
     Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _  
           strComputer & "\root\default:StdRegProv")
     oReg.GetBinaryValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,iValues
     Dim arrDPID
     arrDPID = Array()
     For i = 52 to 66
     ReDim Preserve arrDPID( UBound(arrDPID) + 1 )
     arrDPID( UBound(arrDPID) ) = iValues(i)
     Next
     ' <--------------- Create an array to hold the valid characters for a microsoft Product Key -------------------------->
     Dim arrChars
     arrChars = Array("B","C","D","F","G","H","J","K","M","P","Q","R","T","V","W","X","Y","2","3","4","6","7","8","9")
     
     ' <--------------- The clever bit !!! (Decrypt the base24 encoded binary data)-------------------------->
     For i = 24 To 0 Step -1
     k = 0
     For j = 14 To 0 Step -1
      k = k * 256 Xor arrDPID(j)
      arrDPID(j) = Int(k / 24)
      k = k Mod 24
     Next
     strProductKey = arrChars(k) & strProductKey
     ' <------- add the "-" between the groups of 5 Char -------->
     If i Mod 5 = 0 And i <> 0 Then strProductKey = "-" & strProductKey
     Next
     strFinalKey = strProductKey
     '
     ' <---------- This part of the script displays operating system Information and the license Key --------->
     '

     Set wshShell=CreateObject("wscript.shell")
     strPopupMsg = strPopupMsg & "Your Windows Product Key is:" & vbNewLine & vbNewLine & strFinalKey
     wshShell.Popup strPopupMsg,,strPopupTitle,vbCancelOnly+vbinformation
     WScript.Quit

     

    copy and paste into notepad....change extension to vbs...

    (this was not my personal code....I extracted it from somewhere else...)

    0
  • Thank you for that code. We're are planning on scanning for product keys but haven't gotten to the implementation stage yet.  This should help out.

    0
  • This feature was added in 1.1 Release 2. You can see it under the Operating System section of the Computer panel (along with the other OS attributes). You can also access it via the Operating System table in Collections and Reports. The image below shows a Collection which will only contain computers which have "-640-" in their OS Serial Number.

    OEMCollection.png

    0