本地安装 IIS 来远程访问 IIS 的替代方案?

发布于 2024-08-11 11:02:57 字数 627 浏览 6 评论 0原文

我有一个应用程序,它使用 DirectoryEntry 对象(在 System.DirectoryServices 中)访问有关远程计算机上 IIS 上运行的网站的信息。

运行该应用程序的任何客户端计算机都需要安装 IIS,否则应用程序在访问 IIS 信息时会引发 System.Runtime.InteropServices.COMException。

有没有一种方法可以让我只包含 dll、添加引用或类似的内容,以便在客户端计算机不安装 IIS 的情况下能够访问该信息?或者是否有更好的方法来访问该信息(也许没有 System.DirectoryServices)也可以绕过此要求?

编辑:再次查看此问题,并在此处查看问题这里,我相信这是不可能的使用 DirectoryServices 来获取此信息。我将保留它以供建议的替代方案,也许有关 WBEM 脚本的更多信息?

I have an app that accesses information about websites running on IIS on a remote machine, using DirectoryEntry objects (in System.DirectoryServices).

Any client machine that runs the app needs to have IIS installed or the app throws a System.Runtime.InteropServices.COMException when it accesses the IIS information.

Is there a way I can just include a dll, add a reference, or something similar to be able to access that information without the client machine installing IIS? Or is there a better way to access that information (without System.DirectoryServices, perhaps) that would also bypass this requirement?

EDIT: Looking at this problem again, and seeing the questions here and here, I believe it is not possible to use DirectoryServices to get this information. I'll leave it open for alternatives to be suggested, maybe more info on WBEM scripts?

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

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

发布评论

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

评论(2

暮凉 2024-08-18 11:02:57

所以我的理解是,您正在尝试从远程 IIS 服务器获取网站信息,但尝试获取该信息的客户端必须安装 IIS 才能查询这些远程系统。这并不是因为它使用某种网络应用程序来获取信息;而是因为它使用了某种网络应用程序来获取信息。它使用安装 IIS 时安装的一些功能。

您需要什么样的信息?您不能使用针对 IIS 计算机的 WBEM 脚本来获取您想要的信息吗?

So what I understand is that you're trying to get website info from remote IIS servers, but the client that is trying to get that information must have IIS installed in order to be able to query those remote systems. And it's not because it's using some kind of web-app to get the info; it's using some functionality that is installed when IIS is installed.

What kind of information are you after? Can't you use WBEM scripts targeting the IIS machine to get the information you're after?

水溶 2024-08-18 11:02:57

经过进一步研究:

Chris 正在谈论 WMI 脚本和 System.Management 命名空间,只要您连接到 IIS 6 或更高版本,它就可以正常工作。

DirectoryServices 需要安装 IIS,因为它向 ADSI 添加了额外的位以允许其查询 IIS。此外,如果您使用 IIS 5 (Windows XP) 或 IIS 7 (Windows 7) 来获取正确的 ADSI 组件,则需要安装 IIS 6 兼容性管理器。

IIS 7 还有最后一个替代方案,即 Microsoft.Web.Administration 命名空间。

不幸的是,在我的场景中,我需要同时使用 IIS 5 和 IIS 6,这意味着 DirectoryServices 是获得我所需内容的唯一方法。幸运的是,我相信只需要安装兼容性管理器,而不是整个 IIS 服务器(希望这是 Windows XP 上的一个选项...)

接受 Chris 作为 WBEM 建议的答案,尽管我无法使用它在这种情况下!

After further research:

Chris was talking about WMI scripts and the System.Management namespace, which works fine as long as you're connecting to IIS 6 or above.

DirectoryServices needs IIS installed, because it adds extra bits to ADSI that allow it to query IIS. In addition, you need to install an IIS 6 compatibility manager if you're using IIS 5 (Windows XP) or IIS 7 (Windows 7) to get the right ADSI components.

There is a final alternative for IIS 7, which is the Microsoft.Web.Administration namespace.

Unfortunately, in my scenario I need to use both IIS 5 and IIS 6, meaning that DirectoryServices is the only way to get what I need. Luckily, I believe only a compatibility manager needs to be installed rather than the whole IIS server (hopefully this is an option on Windows XP...)

Accepted Chris as the answer for the suggestion on WBEM, even though I can't use it in this case!

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