views:

1567

answers:

2

I need to create and modify tasks in Windows Task Scheduler on Windows Server 2003 from an ASP.NET web application. The Network Service that the web app runs under is unable to make the changes. It errors with an System.UnauthorizedAccessException exception.

It works fine running from Visual Studio on my desktop.

What permissions do I need to grant an account so that the tasks can be modified from ASP.NET?

+1  A: 

The account needs to have read/write permissions to the "Tasks" directory. Here's the path:

%SystemRoot%\system32\Tasks\
Jose Basilio
+1  A: 

Jose's answer solved my problem partially. However, there was an additional problem where Windows Server 2003 didn't like me specifying Local System as the account that the task would run under. It seemed to not like me passing in a null password which is how you specify Local System. I worked around the problem by making a local account on the server for tasks to run under and specifying this new account.

Specifying Local System didn't cause any problem on Windows XP.

Additional info

GiddyUpHorsey