Kaseya Community

File retrieval script

  • How do I write a script to retrieve and email a text file? I want to email the text output of our AV scans.

    Thanks

    Mac

    Legacy Forum Name: File retrieval script,
    Legacy Posted By Username: Mac
  • you use the get variable - file content procedure in the script, assign it a variable name in the step ...then in the send email script you reference the variable name as follows #variable_name# ... with the #'s on both ends and you can have that in the body of the email .... if you want a tad more sophisticated also get variable - machine name and have the subject line reference the #MachineName# variable you assign so you can tell what machine this is from as well ....

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: TBK Consulting

  • Get Variable
    Parameter 1: 10
    Parameter 2:
    Parameter 3: Agent
    Get Variable
    Parameter 1 : 1
    Parameter 2 : #Agent#\log.log
    Parameter 3 : SAVlog
    OS Type : 0
    Get Variable
    Parameter 1 : 6
    Parameter 2 :
    Parameter 3 : MachineGroup
    OS Type : 0
    Send Email
    Parameter 1 : success@yourdomain.com
    Parameter 2 : Notification: Virus scan log for #MachineGroup#
    Parameter 3 : #SAVLog#
    OS Type : 0
    Delete File
    Parameter 1 : #Agent#\log.log
    OS Type : 0


    Change e-mail address and logfile name to match your enviroment. You can almost import this script ... almost.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: Lmhansen
  • Sweet! Thats much simpler than I expected... funny how that works. Thanks for the help.

    Mac

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: Mac
  • I have finally got the file retrieval scripting figured out for a static name but I am stumped on how to retrieve a file that always has a variable in the file name such as the time and date. Thanks for all the help, this forum is terrific.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: Mac