Saturday, January 21, 2017

"On connection to user session" trigger not firing? Run as SYSTEM

The "on connection to user session" trigger in Task Scheduler can be used to run a task whenever a user connects or reconnects to their logon session, either at the workstation or by Remote Desktop. Bizarrely, the task never seemed to run for one person. I got the same behavior when I set up the task as they did.

After I set the task to run as SYSTEM and adjusted the parameters to powershell.exe to provide a full path to the script they were trying to run, it worked. Both of those changes had to be made for me to see it work; I tried all four combinations. I'm puzzled as to why SYSTEM is special here (running as an admin or even a normal user should have worked with my test setup), but it's something to try if you're having Task Scheduler problems.

No comments:

Post a Comment