views:

515

answers:

1

On Windows machines, schtasks is a utility similar to cron for scheduling jobs to run on a regular basis.

Problem is, when you define a schtask, you must specify the userid and password of the account to run the job.

Then later, when the user changes his password, that schtask will no longer work. It must be deleted and rescheduled with the new password.

So, how can I setup a scheduled job (via schtasks, at, whatever) that's immune to password changes?

+3  A: 

This doesn't quite answer your question, but a common workaround is to create a user (with appropriate privileges) and use that account solely for executing scheduled tasks.

As the user account is created with a non-expiring password, the sysadmin who creates it should choose an appropriately strong password.

teedyay
Hah, just when I wanted to click "Post your answer"...beat me to it ;-) +1
Zaagmans
In a production environment this is general the best practice as well. Regular user accounts can have their permissions changed or revoke, or can be removed or disabled entirely. A service account is much easier to manage, as well as limit the scope of.
David