Link to home
Start Free TrialLog in
Avatar of alanlam123
alanlam123

asked on

How to run powershell script to automate

Hi expert

How to write a powershell script to automate the process for getting a file from the C drive from the server show in the followng path  "C:\Program Files (x86)\CCTE\OutstandingBalance " and email to users.

Thanks
Alan lam
ASKER CERTIFIED SOLUTION
Avatar of J0rtIT
J0rtIT
Flag of Venezuela, Bolivarian Republic of image

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
Avatar of alanlam123
alanlam123

ASKER

thanks for your help i will test it.
Hi

I am encountered the followng  issue;

$cred = New-Object pscredential -ArgumentList @("alan.lam@zuji.com", "La@88898" | ConvertTo-SecureString -AsPlainText -Force)
Send-MailMessage -From alan.lam@zuji.com -To toAddress@lamsoonwin@gmail.com -Attachments @("M:\SIN\RprtZuji\Fri 12_22_2017\files.xls") -Subject "Mail Subject" -SmtpServer "mail.webjet.com.au" -Credential $cred
Capture-for-powershell-errros.PNG