Kaseya Community

Script to extract windows and office key codes

  • This script will get the install codes for Windows and office and write them to the script log.

    Handy for compliance and for those clients that lost their key codes.

    You will need to download keyfinder.exe from www.magicaljellybean.com/keyfinder.shtml



    -------------------------------------------

    Script Name: Get Windows and Office Key Codes
    Script Description: Runs keyfinder to get codes, writes codes to text file, gets text file and copies to script log.

    IF True
    THEN
    Get Variable
    Parameter 1 : 0
    Parameter 2 : HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\computername
    Parameter 3 : computername
    OS Type : 0
    Get Variable
    Parameter 1 : 10
    Parameter 2 :
    Parameter 3 : agenttmp
    OS Type : 0
    Write File
    Parameter 1 : #agenttmp#\keyfinder.exe
    Parameter 2 : VSASharedFiles\keyfinder.exe
    OS Type : 0
    Execute Shell Command
    Parameter 1 : #agenttmp#\keyfinder.exe /save /close
    Parameter 2 : 0
    OS Type : 0
    Get Variable
    Parameter 1 : 1
    Parameter 2 : #agenttmp#\#computername#.txt
    Parameter 3 : keycodes
    OS Type : 0
    Write Script Log Entry
    Parameter 1 : Keycodes - #keycodes#
    OS Type : 0
    Delete File
    Parameter 1 : #agenttmp#\#computername#.txt
    OS Type : 0
    ELSE




    Legacy Forum Name: Script to extract windows and office key codes,
    Legacy Posted By Username: rvines
  • great script. I would like to mention that in my experience, the Office key is right most of the time, and the Windows Key is never right.

    I believe that Windows scrambles the key code, so even though it gives you a key that looks legit, you cannot actually use it in any real way that I am aware of.

    Again... the Office key is almost always the correct key, so you can use that one....

    now a coprporate key might appear with the jelly bean... I have not tested it.

    sometimes the key is listed here too.

    HKEY_LOCAL_MACHINE/SOFTWARE/MICROSOFT/WINDOWS/CURRENTVERSION/Productkey

    but all in all I am unaware of any software tool that will give you the proper CD install key for an OS.

    Gamer-X



    Legacy Forum Name: System Administration Scripts,
    Legacy Posted By Username: Gamer-X
  • You may be right. I've never tested the code. Is there a way to find out if your code is legit (other than trying an install?)

    Legacy Forum Name: System Administration Scripts,
    Legacy Posted By Username: rvines
  • I would guess that if your keys dont work then you are pairing it with the wrong media version.

    XP Keys for OEM, Select, Retail, MSDN etc....are not interchangeable.


    Legacy Forum Name: System Administration Scripts,
    Legacy Posted By Username: XeviouS
  • Kaseya does this inherently now in the Audit function - no need for Magic Jelly Bean anymore!

    Legacy Forum Name: System Administration Scripts,
    Legacy Posted By Username: tom@tbkconsulting.biz
  • I've been rendered uneccessary once again! Doh!

    Legacy Forum Name: System Administration Scripts,
    Legacy Posted By Username: rvines