Robert Perez-Corona
asked on
Powershell script to send email via Gmail if file is older than specified time
Hello,
I have a directory on a windows 2012 server where text files are dumped in order to be uploaded to a SQL server for ETL purposes; which generate a report to for a production site.
I need a powershell script ( or any script) to alert me via gmail (google apps) if the files in my directory are older than "X" amount time; 15 hours to be exact.
many thanks in advance
t
I have a directory on a windows 2012 server where text files are dumped in order to be uploaded to a SQL server for ETL purposes; which generate a report to for a production site.
I need a powershell script ( or any script) to alert me via gmail (google apps) if the files in my directory are older than "X" amount time; 15 hours to be exact.
many thanks in advance
t
Why not download and install the free version of PRTG for proper monitoring instead?
ASKER
Thanks for pointing out other solutions
With respect to prtg, I already have nagios and currently working on implementing GLPI.
Do you think I can achieve the same with nagios?
I'm any case, how would any of these net mon tools monitor the date/time stamp ?
I have a feeling this will require some tweaking
With respect to prtg, I already have nagios and currently working on implementing GLPI.
Do you think I can achieve the same with nagios?
I'm any case, how would any of these net mon tools monitor the date/time stamp ?
I have a feeling this will require some tweaking
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks x-men let me give the the script a shot
ASKER
Exception calling "Send" with "4" argument(s): "The SMTP server requires a secure connection or the client was not auth
enticated. The server response was: 5.5.1 Authentication Required. Learn more at"
At C:\Users\myuser\Documents\ email-aler t.ps1:11 char:21
+ $SMTPClient.Send <<<< ($EmailFrom, $EmailTo, $Subject, $Body)
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
I replaced the variables inside the quotations with my own values (kept the quotes) yet I received the message above related to auth
enticated. The server response was: 5.5.1 Authentication Required. Learn more at"
At C:\Users\myuser\Documents\
+ $SMTPClient.Send <<<< ($EmailFrom, $EmailTo, $Subject, $Body)
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
I replaced the variables inside the quotations with my own values (kept the quotes) yet I received the message above related to auth
It seams like you were unable to authenticate with Google. There is a security option on Google accounts to allow connections from legacy applications (it's just a name that Google gives to what ever's not from Google)... Will send you the complete walkthrough in about 12 hours. (Got to get my beauty sleep...)
ASKER
cheers x-men
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.