gpt4 book ai didi

ironpython - 如何使用 IronPython 模拟当前用户?

转载 作者:行者123 更新时间:2023-12-03 04:40:36 26 4
gpt4 key购买 nike

我正在尝试使用 Microsoft.Web.Administration 库远程管理 IIS7 安装。

我在 IronPython 中执行此操作:

import Microsoft.Web.Administration
from Microsoft.Web.Administration import ServerManager

manager = ServerManager.OpenRemote("RemoteServerName")
for site in manager.Sites:
print "Site: %(site)s" % { 'site' : site.Name }

在最后一行,当它尝试与远程服务器通信时,我收到以下错误:

Retrieving the COM class factory for remote component with CLSID {2B72133B-3F5B-4602-8952-803546CE3344} from machine devdealernetsvr failed due to the following error: 80070005.

我对该错误的研究使我相信我没有针对远程计算机的正确凭据,因此我想冒充拥有该凭据的用户。

我很难找到一种方法来使用 IronPython 来做到这一点。非常感谢任何帮助。

最佳答案

(这不一定回答问题,但确实解决了问题)

事实证明我的应用程序运行良好。我的设置是问题所在。 :(

要解决我的问题,我需要:

  1. 登录远程服务器。
  2. 在 IIS 中启用远程管理(只是一个复选框)
  3. 在“服务”管理单元中,启动远程管理服务并将其设置为自动

谢谢安东尼!

关于ironpython - 如何使用 IronPython 模拟当前用户?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1362830/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com