Forum Discussion

Ksquared_AU's avatar
Ksquared_AU
Copper Contributor
Jun 07, 2019

Powershell v's Task Scheduler

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

 

  • donnuwan's avatar
    donnuwan
    Copper Contributor
    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
  • Kevin_Morgan's avatar
    Kevin_Morgan
    Iron Contributor

    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.

  • Darrick's avatar
    Darrick
    Brass Contributor

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

     

    That is not a good practice.

Resources