Run a scheduled task as an unprivileged user remotely

task-schedulerwindows-server-2008

I need to allow a group of unprivileged users to trigger a predefined scheduled tank on a Windows Server 2008 R2 host. I seem unable to find the respective rights to do so. Upon an attempt to connect to the remote Task Scheduler, the remote system just gives me the middle finger:
You do not have permission to access this computer

Even when a user is logged on on interactively, I cannot figure out how I would grant her the necessary permissions to run a task. In the pre-2008-era, a .job file has been created in the %SYSTEMROOT%\SYSTEM32\Tasks folder, where you could manipulate ACLs and influence the task scheduler behavior. In 2008, there seems to be no similar facility.

Note that I do not want to create additional tasks, I just want to run an existing one.

Best Answer

I had a similar issue under Windows Server 2012 R2 and found the following working solution:

  • grant the users write access to the XML files in c:\windows\system32\tasks
  • grant the users permissions for Powershell Remoting
  • let users use Powershell Invoke-Command cmdlet to run SCHTASKS on the remote server:
powershell.exe -command "invoke-command {schtasks /run /tn TASKNAME} -computer SERVERNAME"