Click here to Skip to main content
16,018,818 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
My problem is briefly described here:
A New Task Scheduler Class Library for .NET[^]

I am using the code from A New Task Scheduler Class Library for .NET[^] to create scheduler tasks from my ASP web page.

Problem is, it works on my local machine (when testing) but not on the server (IIS6, Windows 2003).

It gives me this error Exception from HRESULT: 0x80070005 (E_ACCESSDENIED).

I have made a new administrator account on the server just for this job, entered it in IIS application pool for this website to run as this user, enabled anonymous access with the same user and am also using the same account for the credentials in code:

t.SetAccountInformation(user, userPass);


The Task Scheduler service is running as local user, if I try to change that I get the an error which tells me that the other services that Task Scheduler depends on are running as another user and therefore can't change it.

In every case I get Access Denied error and I am out of ideas on what else to check/change to make this work.

I have tried googling this but no satisfying answer so far.

Any help with this would be greatly appreciated.

Thanks in advance
Posted
Updated 5-Apr-11 2:28am
v2

1 solution

I looked at that article, and someone else posted this:

You must write a flag after the setaccountinformation :

C#
_Task.Flags = TaskFlags.RunOnlyIfLoggedOn;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900