Kaseya Community

kaseya vtac username as a variable

  • i'm using kaseya to monitor server status for clients and i would like to generate some reports and have them emailed to me. because we have several engineers here that would like to run the shared scripts manually, is it possible to have the emails sent to the engineer that ran the script instead of having to edit the script and change the email address.

    just an example to get my point across:

    [INDENT]john logs into kaseya VTAC with username 'john' and runs report script, script should obtain the username 'john' and append that to '@domain.com' to form john@domain.com for the email.

    jane also logs into kaseya vtac with username 'jane' and also runs the script and script should email to jane@domain.com having obtained 'jane' from the kaseya VTAC username.
    [/INDENT]

    currently, i've got the email address hardcoded in the script because i don't know how to obtain that username variable. is this possible?

    Legacy Forum Name: kaseya vtac username as a variable,
    Legacy Posted By Username: mkddy
  • You could create a Managed Variable called EngineerEmailAddress, and set that variable to the email address of the Engineer that should receive the emails for each Machine Group.

    Then in your script, refer to the Managed Variable instead of the actual email address. Note that for Managed Variables you use the <> symbos, rather than # symbols in scripts.

    Online help probbaly has some more info on Managed Variables.

    Hope this helps.

    Lloyd

    Legacy Forum Name: How-To,
    Legacy Posted By Username: lwolf
  • lwolf
    You could create a Managed Variable called EngineerEmailAddress, and set that variable to the email address of the Engineer that should receive the emails for each Machine Group.

    Then in your script, refer to the Managed Variable instead of the actual email address. Note that for Managed Variables you use the <> symbos, rather than # symbols in scripts.

    Online help probbaly has some more info on Managed Variables.

    Hope this helps.

    Lloyd

    that's not what i'm really after though. no engineer is assigned to anyone client specifically. so i could be running the script for machine id 'A' this mth, and someone else run the script for the same machine id next mth. bottom line is, i need the send to field to populate with the engineer running the script at the time.

    Legacy Forum Name: How-To,
    Legacy Posted By Username: mkddy
  • Sorry abotu that, I misunderstood.

    I don;t know of any way to have Kaseya email a report to the currently logged-in user.

    But, here may be a work around. If I wanted to do this in my office, I would create an Exchange Public Folder with the Name ScriptReport, and the correcponding email address ScriptReport@mycompany.com. Then make the script send the email message to that email addresses. Then tell my folks to look in that Exchange Public Folder for the report, whenever they run the script(s).

    Hope this helps.

    Lloyd

    Legacy Forum Name: How-To,
    Legacy Posted By Username: lwolf
  • lwolf
    Sorry abotu that, I misunderstood.

    I don;t know of any way to have Kaseya email a report to the currently logged-in user.

    But, here may be a work around. If I wanted to do this in my office, I would create an Exchange Public Folder with the Name ScriptReport, and the correcponding email address ScriptReport@mycompany.com. Then make the script send the email message to that email addresses. Then tell my folks to look in that Exchange Public Folder for the report, whenever they run the script(s).

    Hope this helps.

    Lloyd

    thanks for that, your suggestion was going to be my next workaround. i was only looking into this because the kaseya online manual uggested that you could use #SQLview.columnName#@domainname.com but i can't seem to find a table/column that will give me that information of who's logged in.

    setting up a public folder would still be a solid way of doing things. thanks again.

    Legacy Forum Name: How-To,
    Legacy Posted By Username: mkddy
  • If you look at the view vScriptStatus you will see all scripts that have run for a certain period and it contains the admin that ran that script.

    If you take a copy of that view and create a new view and sort it descending by the date the script executed you can use this view to find the login name of the admin that ran the script.

    A couple of additional points.
    1) A script that is Run immediately shows up twice in the log right away once with the script name the other with Run Now - script name.

    2) A script that is sceduled does not show up until the script completes. In this case at the end of this script you would need to schedule a second script to run 1 minute later like "Send Mail to Admin". Once the 1st script executes, the view will contain the entry for that first script and you can get the username from the view.

    3) You may want to streamline the view a little bit by only getting records that have been updated in the last hour and maybe excluding those records that are run by system (like KES) that may get exectuted in between the 1st script and "Send Mail to Admin"

    I do know that you can create a view and use it in the exact same way as a standard Kaseya View. As I understand it, it searches for the AGUID and returns the 1st record that it finds. You do need to set the secutiry properly on the view so that it can be access by KaseyaViews. Compare with the security from one of the standard scripts.

    Legacy Forum Name: How-To,
    Legacy Posted By Username: doug.jenkins@ispire.ca
  • mkddy
    thanks for that, your suggestion was going to be my next workaround.

    setting up a public folder would still be a solid way of doing things. thanks again.


    Glad to hear the workaround suggestion might be useful. Good luck.

    Lloyd

    Legacy Forum Name: How-To,
    Legacy Posted By Username: lwolf