C# 模拟问题

发布于 2024-11-17 19:11:50 字数 465 浏览 1 评论 0原文

我有一个运行执行批处理文件的方法。这一直有效,直到我实现了 IIS7 集成管道身份验证,限制对我的应用程序中托管的任何静态文件的访问。

此后我发现添加此更改后,该进程会尝试通过 NETWORK SERVICE 帐户执行,而不是通过 web.config 中的模拟令牌执行。

是否有任何原因或我可以强制该方法使用模拟用户的方法?

编辑

当然,现在我已经实现了集成管道,应用程序将批处理文件视为静态文件,并尝试通过讨厌的用户帐户访问它,该帐户设置为应用程序池标识,而该标识又使用 NETWORK SERVICE 帐户。

这些文件位于硬盘驱动器上单独的类库目录中,并且不通过应用程序托管。我尝试通过将它们添加到我的应用程序中的文件夹中来纠正此问题,希望现在集成的管道能够看到用户已通过身份验证并允许访问。事实并非如此,批处理文件仍然使用匿名身份验证帐户执行。 :(

谢谢!

I have a method that runs executes a batch file. This worked until I implemented the IIS7 integrated pipeline authentication, restricting access to any static files hosted in my app.

I have since found out that adding this change, that the process tries to execute through the NETWORK SERVICE account instead of my impersonation token in my web.config.

Is there any reason for this or a way for me to force the method to use the impersonated user?

EDIT

Of course now Ive implemenet the integrated pipeline, the application sees the batch file as a static file and was trying to access it via the annoymous user account, which was set to application pool identity, which in turn is using NETWORK SERVICE account.

the files were situated in a separate class library directory on the hard drive and not hosted through the application. I have tried to rectify this by adding them to a folder in my application, hoping that now integrated pipeline would see that the user is authenticated and allow access. This is not the case, the batch files are still executed using the annoymous authentication account. :(

Thanks!

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

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

发布评论

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

评论(1

命硬 2024-11-24 19:11:50

如果有人到达这里,那么我建议前往此网站

http://blogs.msdn.com/b/alejacma/archive/2007/12/20/how-to-call-createprocesswithlogonw-createprocessasuser-in-net.aspx

我发现 createprocessasuser 方法工作是一种享受。但现在我正在努力使用管道来从上述方法中获取标准输出。我使用这篇文章来帮助解决这个问题,

如何获取CreateProcessWithLogonW 的标准输出?

希望这有帮助!

If anyone gets here then I would suggest heading to this site

http://blogs.msdn.com/b/alejacma/archive/2007/12/20/how-to-call-createprocesswithlogonw-createprocessasuser-in-net.aspx

I found that the createprocessasuser method works a treat. But now Im struggling with pipes to get the standard output from said method. Im using this post to help with this,

How to get standard output from CreateProcessWithLogonW?

hope this helps!

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