0

I am trying to query,create and delete a task in C# through schtasks.exe as a process.

As an administrator everything works fine but when run as non-admin user, I get access denied message. I tried giving user permission on C:\Windows\System32\Tasks folder through Calcs.

Also tried giving permission to start and stop service through SubInAcl /Service Schedule /Grant=DOMAIN\nonadminuser=TO

Error: OpenService Error:5 Access is denied.

User cannot be a power user or Backup Operators.

Let me know if there is anything that can be done.

Vaishnavi
  • 1
  • 2

1 Answers1

0

could you impersonate an admin user when creating the task?

Impersonation

Also there is a .NET wrapper for the task scheduler - Task Scheduler Wrapper which may be easier to use the the command line version you are using, not sure if it would help with the access denied issue though.

ajg
  • 1,743
  • 12
  • 14