Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 116885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:14:55+00:00 2026-05-11T03:14:55+00:00

I have an ASP.NET website (in C#) that takes in user data and then

  • 0

I have an ASP.NET website (in C#) that takes in user data and then attempts to create a windows scheduled task. Of course, this works great on the DEV machine, but fails to run on the server. I’m trying to figure out what permission(s) are required on the ASPNET user (or anonymous web user) to create tasks.

The error is:

Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))  Stacktrace:      at MyScheduler.NewWorkItem(String TaskName, Guid& rclsid, Guid& riid, Object& obj)      at MyScheduler.CreateTask(String name) 

I’ve done some searching, and the suggested resolution is to use the web.config ‘impersonate’ flag to force the application to run as a user with sufficient permissions, as opposed to the ASPNET account which may not have those permissions.

Example:

<system.web>     <identity impersonate='true' /> </system.web>  

Unfortunately, this does not seem to resolve the issue. From the documentation I read, this should run as the anonymous web user, but it seems that user does not have enough permissions.

I altered the setting to specify a specific domain user that happens to be an administrator on the machine. Example:

<system.web>     <identity impersonate='true' userName='WindowsDomain\YourUserName' password='YourPassword' /> </system.web>  

Doing this allowed the application to successfully create the Windows Scheduled Task. So, obviously, with the correct set of Windows 2003 permissions I can get the app to perform as it does in the development environment. However, I’m not about to place the network or machine administrator account’s user credentials in plain text on a Web.config file.

Does anybody happen to know what permissions exactly need to be set in order to get the ASPNET account to behave as desired?

EDIT: The Win32 API is being used to create scheduled tasks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T03:14:56+00:00Added an answer on May 11, 2026 at 3:14 am

    I have been able to solve my particular problem, though not completely. I have still not identified the exact rights needed to create and run scheduled tasks, but the following seems to work:

    1. Add the <identity impersonate='true' /> to the Web.config
    2. Add the IUSR user (which is the user the app will run as using impersonate) to the ‘Backup Operators’ group.

    This gives the application access to the Scheduled Tasks folder so that they can create and run the task.

    We had an additional issue, which was that the tasks were attempting to run as the Local System Account. Unfortunately, only administrators seem to be able to assign the Local System Account as the running user, so we needed to impersonate as an Administrator account, not as a Backup Operator in order to get our code functioning correctly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 77k
  • Answers 77k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Here is some basic code that doest a POST call:… May 11, 2026 at 3:19 pm
  • added an answer What you should do is in your controller check to… May 11, 2026 at 3:19 pm
  • added an answer I like the subcommand pattern, which I'm most familiar with… May 11, 2026 at 3:19 pm

Related Questions

Important: This question isn't actually really an ASP.NET question. Anyone who knows anything about
I'm building an ASP.Net MVC website. Rather than have everything in one project, I've
I'm running Vista 64 box, and attempting to setup Joomla using IIS7 (I like
I have before created a quick Ajax Framework for one of my projects. It

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.