Kaseya Community

Microsoft License Keys Script

  • Get License Keys.zip
    Hello Everyone,

    We are a new MSP Kaseya customer, first of all I am amazed at the helpfulness this Kaseya community provides to each other. Thanks a lot to everyone for their efforts.

    Not that I am an expert on the scripts, I thought I should post my first script that may help people out. This scripts scans the desktops and servers using a keyfinder software to retrieve the license keysand uploads it to the specific Agent Get file storage.

    This keyfinder is a beta version that now supports vista and office 2007.

    Steps to setup script:

    1) Download and extract keyfinder.exe from the attached zip file or from http://mjbforum.com/files/keyfinder.2.0.beta.2.5.zip, upload it toVSA Shared files storage

    2) Import this script from the zip file or from text output below:

    Script Name: Get License Keys
    Script Description: Used to retrieveOS and Office License Keys for documentation

    IF Test File
    Parameter 1 : c:\temp\Keyfinder.exe
    Exists :
    THEN
    Execute File
    Parameter 1 : c:\temp\Keyfinder.exe
    Parameter 2 : /save /close
    Parameter 3 : 1
    OS Type : 0
    Get Variable
    Parameter 1 : 1
    Parameter 2 : c:\temp\%COMPUTERNAME%.txt
    Parameter 3 : LicenseKeys
    OS Type : 0
    Get Variable
    Parameter 1 : 6
    Parameter 2 :
    Parameter 3 : machineName
    OS Type : 0
    Send Email
    Parameter 1 :your_e-mail@email.com

    Parameter 2 : License Keys from #machineName#
    Parameter 3 : #LicenseKeys#
    OS Type : 0
    Get File
    Parameter 1 : c:\temp\%COMPUTERNAME%.txt
    Parameter 2 : Licenses\Licenses.txt
    Parameter 3 : 0
    OS Type : 0
    ELSE
    Write File
    Parameter 1 : c:\temp\keyfinder.exe
    Parameter 2 : VSASharedFiles\keyfinder.exe
    OS Type : 0
    Execute File
    Parameter 1 : c:\temp\keyfinder.exe
    Parameter 2 : /save /close
    Parameter 3 : 1
    OS Type : 0
    Get Variable
    Parameter 1 : 6
    Parameter 2 :
    Parameter 3 : machineNameNew
    OS Type : 0
    Get Variable
    Parameter 1 : 1
    Parameter 2 : c:\temp\%COMPUTERNAME%.txt
    Parameter 3 : LicenseKeysNew
    OS Type : 0
    Send Email
    Parameter 1 : your_e-mail@email.com
    Parameter 2 : License Keys from #machineNameNew#
    Parameter 3 : #LicenseKeysNew#
    OS Type : 0
    Get File
    Parameter 1 : c:\temp\%COMPUTERNAME%.txt
    Parameter 2 : Licenses\Licenses.txt
    Parameter 3 : 0
    OS Type : 0

    3) Change the E-mail address in the scripts to the account you would like the license keys to be e-mailed or remove the send e-mail step altogether.

    Hope this helps,

    Frank

    Legacy Forum Name: Microsoft License Keys Script,
    Legacy Posted By Username: Farru21
  • Nice script! Well done! Cool

    Legacy Forum Name: Script Requests,
    Legacy Posted By Username: raybarber
  • Very Cool, you can enhance this by writing it to the script log for reporting on several machines using the Logs Reports and running it against the script log.

    Legacy Forum Name: Script Requests,
    Legacy Posted By Username: sourceminer
  • Thanks for the comments, yes generating a log report is in the works!

    Frank


    Legacy Forum Name: Script Requests,
    Legacy Posted By Username: Farru21
  • You would be amazed how useful this script can be. We have been using our own version for months. Sometimes we find it faster to just run the script then to look up the client's Volume license keys.

    Legacy Forum Name: Script Requests,
    Legacy Posted By Username: far182
  • Very nice. Worked perfectly!

    Any other scripts you would like to share?

    David Wertz


    Legacy Forum Name: Script Requests,
    Legacy Posted By Username: DaveW
  • Sorry I am such a newbie where is this VSA shared storage located I cant find it anywhere. HELP!!!



    Thanks in advance.:-D


    Legacy Forum Name: Script Requests,
    Legacy Posted By Username: jvargas105
  • To upload a file go to scripts and locate the icons on the left pane between the section 'Scripts' and 'My Scripts'. This upload icon is the last one that looks like a document. Also If you hover your mouse on top, it will display a tooltip that indicates that it is the button to upload files.

    Once the 'Manage files on server' screen appears, browse and locate the file saved on your local pc and upload it to the 'Shared Files' section,

    HTH

    Frank


    Legacy Forum Name: Script Requests,
    Legacy Posted By Username: Farru21
  • Thanks for the info uploaded fine. I am getting a error in Step 1 I see that the file to execute is in c:\temp I am assuming that is where it went when I uploadedit. Any ideas why I am getting this error in step one? I copied the script to notepad and then imported it. I changed the email addresses, but I am failing at step 1.:shock:

    Legacy Forum Name: Script Requests,
    Legacy Posted By Username: jvargas105
  • Click, click....up on to the soap box.

    I think it's great people want to share scripts but please be considerate. Make your scripts account for other temp folder locations before posting them on the forum. Kaseya's training recommends changing the default temp folder location.Use the get variable script command to get the temp folder location to a variable. You can then use the variable for the rest of the script. If your script calls any externalscripts or programsallow for the temp folder location to be passed viaa command line argument or a similar method. This will make it make easier for the other users of the forum to get your script working the first time.

    Thanks for your attention.

    Click, click....back on the ground again.


    Legacy Forum Name: Script Requests,
    Legacy Posted By Username: connectex