Powershell v's Task Scheduler

Copper Contributor

Weird one.
I have a power shell script that emails a PDF . Script works fine when running in isolation (email and attachment are received). 
How ever when the script is run from task scheduler, only the email is received. The attachment is not attached.

I have tried the execution policy, but in thinking its a file permission thing from scheduler.(running as domain admin)
Any ideas, hive mind?

 

Cheers

 

3 Replies
Hi,
Do you have "Run whether user is logged in or not " checked in?
And also make sure "do not store password is unchecked"
Check the "run with highest privileges as well.

Regards,

D

@Ksquared_AU 

 

Also ensure the domain admin user has enough permission to write file in local path which you have used in your PS script.

Why are you running a scheduled task with domain admin privileges?

 

That is not a good practice.