Click here to Skip to main content
12,558,332 members (61,281 online)
Rate this:
Please Sign up or sign in to vote.
See more: IIS6 C# IIS Scheduler Server , +
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 4-Apr-11 1:14am
Updated 5-Apr-11 2:28am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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

You must write a flag after the setaccountinformation :

_Task.Flags = TaskFlags.RunOnlyIfLoggedOn;

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.161026.1 | Last Updated 5 Apr 2011
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100