Link to home
Start Free TrialLog in
Avatar of kllarson
kllarsonFlag for United States of America

asked on

PS script to scan folder and email results

I'm not a Powershell guru, so I could use a little assistance.

I'm looking for a PS Script that I can set up in Task Scheduler that will run every 10 minutes. I want it to scan an FTP folder and email me the results of any changes. I have tried one that I found on another site, but even thought it appears to run clean, it never submits the email to my local mail server.

Any help would be greatly appreciated.

Thanks,
Ken
Avatar of footech
footech
Flag of United States of America image

If the other one works but just doesn't send the email, go ahead and post it.  It'll save some effort.
Avatar of kllarson

ASKER

Here is the script I found on a Spiceworks thread minus my personal changes to server and email. I have attached it as a .txt file.

This is the setup in Task Scheduler.

Start a program:
powershell -ExecutionPolicy ByPass -file "c:\scripts\ScanFolderForChangedFiles.ps1"
Avatar of Bill Prew
Bill Prew

Did you mean to attach something to the prior post?

~bp
Forgot the extra click on "Upload File"
Scan-Folder-for-Changed_Added-Files.txt
SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the Send-MailMessage tip. I was able to try that and get a test message through. Doing some more testing, but appears to be working now.