Scripts, Tech Random's, Tips and Tricks

Send an Email Using Command Prompt or Batch File Script with PowerShell

This will allow you to to call a powershell script from a batch file that creates and sends an email. You will need: SMTP Outgoing Server SMTP Outgoing Credentials Apply this line to any Batch file line. Our example: robocopy C:\Data D:\Data /L /MIR /Z /Copy:DAT /DCOPY:T /J /mt /tee /r:1 /W:1 /ETA /xd “$RECYCLE.BIN” /log+:”C:\RCLogs.txt” PowerShell.exe -NoProfile -ExecutionPolicy Bypass…

Continue Reading