DEV Community

chustedde
chustedde

Posted on

1

Why is your PowerShell Scheduled Task not running?

This is one of the most-referenced entries I've made in my department's shared notes, so it seemed like a good choice for my first post to a wider audience!

Signature required

Who's running things?

  • Is the task set to run whether or not the user is logged on?
  • Do you have a specific account that runs scheduled tasks?
    • Did you save the correct password when setting up the task?
    • Just try the password one more time... I won't tell anyone you tried typing it instead of copying and pasting πŸ˜…
  • Does the user/script-running account have the correct permissions to do everything you need it to?
    • Folder permissions are a common issue

Trust issues

  • Does the account running the script trust your signature?
    • You may need to trust/re-trust your signature, especially if you were recently issued a new code signing cert
  • If possible, on the machine running the task, open up a command prompt (or PowerShell!) and try launching PowerShell as the user running the task: runas /user:example.edu\taskrunner powershell.exe
    • Try running your script in the new PowerShell window that just popped up
    • When it asks you to trust your script, you say yes [A]lways!

I hope this saves at least a few people from a few moments of frustration. There are weirder issues out there for sure, but this checklist should help you solve the most common ones!

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

Top comments (0)

Sentry image

See why 4M developers consider Sentry, β€œnot bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay