0x80070005 (E_ACCESSDENIED) 在 ASP.NET 应用程序中尝试使用 Windows 任务计划程序时

发布于 2024-08-28 06:55:29 字数 883 浏览 12 评论 0原文

我目前正在VB.NET 中开发ASP.NET 应用程序,其功能之一是使用Windows 任务计划程序。应用程序需要对此进行几乎完全的控制,因为它需要创建、修改、删除和运行任务。

我发现 这个库 可以帮助解决整个问题运行良好,但仅在我的 Windows XP 计算机上本地运行。当我将应用程序部署到 Windows Server 2003 上的 IIS6 并访问使用 Scheduler 对象的页面时,我收到以下错误。

访问被拒绝。 (HRESULT 异常:0x80070005 (E_ACCESSDENIED))

我在网上寻找了各种解决方案,其中包括使用 CACLS 为特定用户(甚至每个人)授予 %windir%\Tasks 权限,但该方法不起作用,还使用模拟并添加IUSER 到备份操作用户组将不起作用,因为应用程序必须使用 Windows 集成身份验证。

让我对整个情况感到困惑的一件事是,我在测试应用程序时登录的用户可以很高兴地远程桌面并登录到服务器并使用任务计划程序。另外,如果我在 Visual Studio 中本地运行该应用程序(仍在同一用户下)并将该应用程序指向服务器的任务计划程序,则它可以正常工作。除此之外,如果我从服务器运行应用程序并将其指向本地任务计划程序,我会收到相同的“访问被拒绝”错误。所有这些让我认为这不是任务计划程序权限问题,而是与任务计划程序库尝试使用的某些组件的权限有关。

有谁知道我可以做些什么来解决这个问题,甚至只是指出正确的方向,因为这已经让我发疯了一天多了。我必须说,在 IIS 问题、模拟和 Windows Server 安全方面,我有点新手。

非常感谢

I am currently working on an ASP.NET application in VB.NET and one of its functions is to use the Windows Task Scheduler. The application will need pretty much full control over this as it needs to Create, Modify, Delete and Run tasks.

I found this library to help with the whole thing and it works well but only locally on my Windows XP machine. As soon as I deploy the application to IIS6 on Windows Server 2003 and access pages that use my Scheduler object I get the following error.

Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

I have looked for various solutions on the net that include giving specific users (and even Everyone) permissions to %windir%\Tasks using CACLS which didn't work and also using impersonation and adding the IUSER to the Backup Operations User Group which won't work as the Application MUST use Windows Integrated Authentication.

One thing that is confusing me about the whole situation is that the User I am logged in as when testing the application can quite happily remote desktop and login to the server and muck about with the Task Scheduler. Also, if I run the application locally in Visual Studio (still under the same User) and point the application at the Task Scheduler of the server it works fine. Further to this, If I run the application from the server and point it at my local Task Scheduler I get the same "Access Denied" error. All of that makes me think it is not a Task Scheduler permissions thingy but something to do with permissions on some components that the Task Scheduler Library is trying to use.

Does any one know what I could do to resolve this or even just a pointer in the right direction as this has been driving me crazy for over a day now. I must say I am a bit of a newbie when it comes to IIS Issues, Impersonation and Windows Server Security.

Thank you very much

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

太阳公公是暖光 2024-09-04 06:55:29

嘿,我知道我可能会迟到,您可以做的就是将任务设置为在 NT AUTHORITY\SYSTEM 下运行,以便使用此

(C#)

string NULL = null ;
任务.SetAccountInformation("", NULL);

并为当前用户设置它,输入用户名

字符串 username = "your xp username";
或者
字符串用户名 = System.Security.Principal.WindowsIdentity.GetCurrent().Name ;
字符串 NULL = null ;

任务.SetAccountInformation(用户名, NULL);

我希望这对你有用!!!!让我知道情况如何!

Hey there i kno i may be late what you can do is either set the task to run under the NT AUTHORITY\SYSTEM for that use this

(C#)

string NULL = null ;
task.SetAccountInformation("", NULL);

and to set it for the current user give the username

string username = "your xp username";
or
string username = System.Security.Principal.WindowsIdentity.GetCurrent().Name ;
string NULL = null ;

task.SetAccountInformation(username, NULL);

that will work for you i hope !!!! and let me know how it was !!!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文