Click here to Skip to main content
11,702,396 members (73,447 online)
Rate this: bad
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 1:14am
Edited 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
0 Maciej Los 505
1 Sergey Alexandrovich Kryukov 355
2 OriginalGriff 299
3 CHill60 145
4 Andy Lanng 99
0 OriginalGriff 8,369
1 Sergey Alexandrovich Kryukov 7,547
2 CPallini 4,922
3 Maciej Los 4,411
4 Mika Wendelius 3,556

Advertise | Privacy | Mobile
Web02 | 2.8.150819.1 | 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