Kaseya Community

Get File from Agent, Transfer to Whomever Runs the Procedure

This question is not answered

Scenario:

I have a procedure that runs a script that gets the biggest files on a machine and writes to a text file in the machine's C:\temp folder.

I want whoever runs this machine to have easy access to this file, whether by an email attachment or by getting the actual file put on their local machine, like their desktop.


I want to avoid forcing my helpdesk to search for the file in FTP.  I also cannot use 'getVariable' as FileContent because it is formatted in tables via monospaced font.

Wishlist for Kaseya:

  • Let us add attachments to the 'sendEmail' procedure
  • Let us send email as HTML via procedures
  • Variable to the admin's machine, if Kaseya Client is present


Whoever helps me with this gets a metaphorical cookie.


EDIT: A potential fix for this would be to have the procedure runner type in their machine name into a prompt upon running the script.

Alternatively, get the runner's machine from the KaseyaD.ini file somehow but that doesn't even make sense because how would I even asdfjeioaijfeoia  Indifferent



Added potentially explored solutions.
[edited by: Sonny Childs at 11:56 AM (GMT -8) on Jan 29, 2015]
All Replies
  • You could have the procedure ask for the tech's email, then use mailsend to attach it to an email.  github.com/.../mailsend

  • Here is an example of emailing an attachment with mailsend.  You can fill in parts of the command from procedure variables:

    mailsend -t recipient@example.com -f from@example.com -sub "my subject line" -M "see attached!" -attach file.zip -smtp mailhost.example.com -port 25 -user user@mailhost.example.com -pass thepassword -auth

  • delete



    a
    [edited by: lofflervision at 1:32 PM (GMT -7) on Mar 26, 2015]
  • I wanted to achieve a very similar result-- create filesize report locally on agent machine, email the report as attachment to our Connectwise alerts board, report is auto-attached to support ticket.  'sendEmail' can't email an attachment and mailsend requires too much customer-specific configuration, requires FW port 25 outbound for agent machine, etc.  

    We ended up using getFile to copy the file back to agent private folder, sending email to connectwise alert board which included (using variables from the alert) an internal link to the report in the agent's private getFile folder (\\Server\Profiles\#vAgentConfiguration.agentGuid#\GetFiles\#dl#_drive_size_report.rpt).  

    Now, if we could just get Low Disk alerts to reliably re-arm and not rely on system audits...

  • Hi Sonny

    You say, "I have a procedure that runs a script that gets the biggest files on a machine and writes to a text file in the machine's C:\temp folder."

    Is that script a VBScript? If so, it would be extremely easy to have the script send the file as an attachment.

    You also say, "I want whoever runs this machine to have easy access to this file, whether by an email attachment or by getting the actual file put on their local machine, like their desktop."

    Do you mean "whoever runs the machine" or do you really mean, "whoever runs the Procedure/Script"?

  • Use PowerShell to send the e-mail - with attachment - in HTML format.

    Should be pretty easy.

    technet.microsoft.com/.../hh849925.aspx

  • Here you go - we use an SMTP server that is locked to our client's Public IP addresses. All clients can mail through it.

    PowerShell command (you should have already defined a variable for your results file):

    Send-MailMessage -To #adminDefaults.adminEmail#  -Subject "#scriptIdTab.scriptName# completed on #vMachine.machName#" -Body "Here are the results of #scriptIdTab.scriptName# on #vMachine.machName# - see attachment." -SmtpServer smtp.myserver.com  -From kaseya@mycompany.com  -Attachments #myResultsFile#



    Tidying up
    [edited by: Lothario at 3:12 AM (GMT -7) on Apr 4, 2015]