Kaseya Community

Agent Temp Directory variable pain

  • I am writing a few scripts that all check for certain files in the Agent Temp Directory Path in the IF statement.

    This means I have to use ANOTHER script (A step 1 script) to GET that variable, for and then a step 2 script to USE that variable for EVERY script.

    Is there a way for me to create a Managed Variable that points to the agent temp directory path, so I don't have to create the variable over and over again?

    Legacy Forum Name: Agent Temp Directory variable pain,
    Legacy Posted By Username: Interprom
  • According to a training vid I recently watched, variables created in one script will be available in any nested script you call. Haven't tried it myself, but the vid did demonstrate this so it should work... Hope that helps!

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: benny@geeksaknockin.com
  • Edit Re: Agent Temp Directory variable pain - Scripts & Agent Procedures - Forums - Kaseya Community muslim dating free sites dog dating site lust dating jean adult singles dating kenel south dakota free dating service canada


    [edited by: Anonymous at 6:31 PM (GMT -8) on 2-21-2011] Edit Re: Agent Temp Directory variable pain - Scripts & Agent Procedures - Forums - Kaseya Community muslim dating free sites dog dating site lust dating jean adult singles dating kenel south dakota free dating service canada
  • Here's an answer that will blow you away - K has certain "SQL" variables that are available to all scripts and are pulled directly from the database.

    For example, I ALWAYS use #vAgentConfiguration.agentTempDir# in my scripts. This goes out to the SQL DB and pulls the agents K temp directory any time you use it. MAJOR time saver! Give it a try, you'll love it!

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: DiPersiaTech
  • That is awesome!

    Is there somewhere I can get a list of variables available and their syntax?

    EDIT: I found them in the help file under "Database Views". You just opened up a whole new world for us! Smile Thanks!

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: Interprom
  • No problem. I've seen some of the best scripters never use these variables - no idea why, but they've cut down on some wasted space in scripts for me and wanted to share.

    Enjoy!

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: DiPersiaTech
  • Interprom
    That is awesome!

    Is there somewhere I can get a list of variables available and their syntax?

    EDIT: I found them in the help file under "Database Views". You just opened up a whole new world for us! Smile Thanks!


    We've been using these for a while and they work great. I haven't had any problems with them at all.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: RCS-Michael
  • Well, this just cut out a bunch of "Launcher" scripts that all they do is grab the agent temp directory and pass it to a nested script in order to test a condition before deciding on which code path to follow (do we just execute or do we deploy and execute? etc).

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: TSI-Eric
  • I cant seem to use this variable when I distribute files via the script tab. It looks as though it only applies inside of scripts.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: ryan.odwyer
  • I asked this question in the past, and was told by K Support that the Distribute File option needs a hard-coded path - no variables supported.

    Lloyd

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: lwolf
  • I've just had to write checks into the IF statement checking for files, and writing it if I havent got to add them to the distribution list, works for the moment until they upgrade the scripting interfaces.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: ryan.odwyer