Kaseya Community

Capturing a PC environment variable

  • With one of the groups, a third party application in use sets their license key in a local environment variable (i.e. like the Path variable). Each PC is assigned a unique value. Is there a way through a procedure to capture and report on these values or is the best practice to write a batch file or some script to read then write the info to a file?

  • Use the "Execute Shell command" with "set >>(your log file here)" and then you can use the "Get File" line to grab the log file and store it on the Kaseya server for review.

  • Thanks for the reply. That is the direction I was heading. I am going to specify a server location for the file so that all the PC's append the same file.

  • Post Script To anyone with the same question:

    Because I wanted to compile the results from all PC's into a single text file on the server I did the following;

    1. Create a batch file and place it on the server.

    1.a first line of the batch file was Echo Off to exclude from results

    1.b The syntax format for the batch commands to retrieve the Environment variables were, SET VAR >> \\server01\myshare\target.txt

    substitute your servername and share folder for server01\myshare, your variable for the word VAR, use the >> to append not overwrite the file, specify the target file to write to by URI

    2. In the Kaseya Agent Procedure use Execute Shell Command with the following syntax START \\server01\myshare\GETVAR.bat

    the start key word was required to get the append functionality. I have learned and have not verified that I might have been able to achieve the same behavior if I had used >>>>. Apparently the > character is used as an escape character.