Friday, August 21, 2015

Windows Task Scheduler Not Running On Some Machines When Locked


I create a bunch of window task scheduler events on multiple win7 machines. These machines automatically lock the user session after a period of time. Note, this is not logging out. These tasks are designed to only run if the user is logged in, regardless if the computer is locked.


On many machines it runs fine. On some few, the task refuses to trigger until the user unlocks the machine. And I cannot figure out why.


The tasks are setup with the following settings:



  • Run only when the user is logged on.

  • Trigger: This can be daily, hourly, weekly, on every day or every other day, etc.

  • Action: Start a program, cmd with a bunch of arguments

  • Condition: Start the task only if the computer is on AC power and stop if the computer switches to battery.

  • Allow task to be run on demand.

  • Stop the task if it runs longer than 3 days

  • If the running task does not end when requested, force it to stop.


I checked the task scheduler history of these tasks on the afflicted computers and it looks like the "Task Engine received message to start" event does not trigger until the user unlocks the machine. On the machines that work, that message occurs on the specified time exactly.


I also checked that the power options on these machines have Wake Timers enabled in the power options under Sleep, google gave that as an issue but it doesn't seem to apply here.


Answer



I believe the issue is the "Wake computer to run task" option not being enabled on the tasks themselves.


Which may seem obvious, but the computers having issues are not "sleeping" which I find peculiar. On the issue machines, once enabling this option, do not seem to have any problems further since I originally posed the question. The other machines which never had the issue make no difference with this option, and share the exact same "sleep" settings at the issue machines.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...