Click here to Skip to main content
11,409,450 members (47,932 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: IIS6 C# 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 2:14am
ZaneRes370
Edited 5-Apr-11 3:28am
v2

1 solution

Rate this: bad
good
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;
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 8,731
1 OriginalGriff 6,895
2 Maciej Los 3,332
3 Abhinav S 3,248
4 Peter Leow 3,059


Advertise | Privacy | Mobile
Web03 | 2.8.150414.5 | Last Updated 5 Apr 2011
Copyright © CodeProject, 1999-2015
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