License Key Retrieval with the K1000 and RecoverKeys

**RecoverKeys is a paid product and can be purchased here: http://recover-keys.com/en/order.html** 

You can use the paid enterprise version of recover keys to retrieve any supported license keys.  The script will upload an HTML file listing all of the keys retrieved from a system as well as write them to the registry so they can be retrieved with a custom inventory rule. 

You will first need to install the program on your local system to get the file dependencies needed for the script to run successfully.  

Most of the files needed will be found in the installation directory (default is c:\program files (x86)\recover keys).   The files needed are: 

  1. English.xml (found in the Lang directory)
  2. RecoverKeys4.zip.enc
  3. RecoverKeysCmd.exe
  4. Sqlite3.dll
  5. Licensekeys_rk23.vbs (link to download: https://docs.google.com/open?id=0BxH6X8H1Q3CRYUZRSTZveUZDTlk

We will configure a script as shown below to run the program and gather our keys.

Configure your script as an Offline Kscript.  Configure the tasks as shown above.  The parameters section for steps 1, 3, and 4 are below so you can copy and paste. 

1  -scanlocal -HTML -hideheader -key:YOURKEYHERE -FILE:"$(KACE_DEPENDENCY_DIR)\rk.html"

3  -scanlocal -TSF  -hideheader  -key:YOURKEYHERE -FILE:"$(KACE_DEPENDENCY_DIR)\rktab.txt"

4  "$(KACE_DEPENDENCY_DIR)\licensekeys_rk23.vbs" "/path:$(KACE_DEPENDENCY_DIR)\rktab.txt"

 Once this is configured save all the changes then save the script itself.  You can now choose machines to run the script on whatever schedule you wish. 

The VBS file in the script will write the keys to the registry so they can be added to the inventory with a custom inventory rule.  Once they are part of the inventory you can report against those fields.

 To create a record with a custom inventory rule, go to Inventory > Software.  Click the Choose Action drop down and choose add new item.

 Name the record and then fill in the custom inventory rule section.  We will be  using "RegistryValueReturn" for this instance.  The keys will be stored in one of two places.  On 64-bit systems it will be "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\kace\Software Licenses All".  On 32-bit sytems it will be "HKEY_LOCAL_MACHINE\SOFTWARE\kace\Software Licenses All"

 Here is an example custom inventory rule "RegistryValueReturn(HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\kace\Software Licenses All, Windows 7 Enterprise  License Key, REG_SZ)"

 That will return the key under the custom inventory rules section of the systems inventory.  You can create multiple inventory rules to pull in the software items of your choice.  


Command line syntax: http://recover-keys.com/kb/command-line-version.html


  • I really appreciate the post. I am having a few issues with the File Loop. It might be an issue with what version I am using perhaps. My text file shows the following

    I am only getting the last entry in the txt file. It creates the Software Title and then creates a REG_SZ that says Product Key with no data in it. Any direction you could point me in for this?

    Thank you, - Hammer1790 9 years ago
  • UPDATE: I was able to get the VBS script to work as needed for the version of Recover-Keys I was using.

    Thanks again for the tutorial! - Hammer1790 9 years ago
  • Hammer1790,

    Could you share with me what version you are using and what you had to do in order to make the VBS work for you? - WhitzEnd 9 years ago
  • I am using version If there were more than two registry keys being created, I lost the actual license key. I added the condition check so it would only pull and create license key files. If the 4 array object (arrField3) didn't equal License Key, it skipped it. I was not too concerned with getting the Product IDs for the software, just the keys themselves.

    Do Until objFile.AtEndOfStream
    strLine = objFile.ReadLine
    arrFields = Split(strLine, vbTab)
    strSoftwareName = arrFields(2)
    Wscript.Echo arrFields(3)
    IF arrFields(3) = chr(34) & "License Key" & chr(34) Then
    strLicense = arrFields(3)
    strProduct = arrFields(4)
    strSoftwareName1 = mid(strSoftwareName,2,len(strSoftwareName)-2)
    strLicense1 = mid(strLicense,2,len(strLicense)-2)
    strProduct1 = mid(strProduct,2,len(strProduct)-2)
    strValueName = strSoftwareName1 & " License Key"
    oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strProduct1
    WScript.Echo strValueName & " = " & strProduct1
    WScript.Echo "Skipping due to false value"
    End IF

    Everything else was perfect for me. Thanks again for the post. Definitely saved a ton of time. - Hammer1790 9 years ago
    • A small update to Hammer1790's code: For some reason, the script would not write to the registry until I commented out all of the "WScript.Echo" lines. Worked like a charm after that. Thanks for the great work!

      Currently using RecoverKeys - tdickinson 8 years ago
      • Thanks so much for the update! Great article all-around! - brad.buckles 7 years ago
  • I have the most recent version installed and both RecoverKeys4.zip.enc and Sqlite3.dll are nowhere to be found in the program files. - LHuntley63 8 years ago
This post is locked
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ