验证虚拟目录 UNC 连接
我需要验证每个虚拟目录的 UNC 连接凭据是否有效并通过身份验证。
我正在使用 Microsoft. Web.Administration API 用于管理我的 IIS 配置。 API 确实公开了 UNC 连接的用户名和密码,但我找不到测试连接结果(参见屏幕截图)。
有没有办法通过 API 检索测试结果?如果没有,您是否熟悉解决该问题的其他方法?
I need to validate that the UNC connection credentials are valid and pass through authentication, for each virtual directory.
I'm using Microsoft.Web.Administration API to manage my IIS configurations.
The API does exposes the Username and password for the UNC connection, but I can't find the test connection results (see screenshot).
Is there a way to retrieve the test results via the API? If not, are you familiar of other approaches to the issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用 .NET Reflector 进行搜索,您会发现该对话框背后的代码位于
Microsoft.Web.Management.Iis.dll
程序集中。该程序集位于 GAC 中(如果您使用 Reflector,只需执行“文件/打开全局程序集缓存”,然后选择此 DLL)。更准确地说,该代码是在
Microsoft.Web.Management.Iis.WebObjects.WebObjectsTestConnectionHelper
类的public PropertyBag TestConnection(PropertyBag bag)
方法中实现的。不幸的是,这个类是非公开的,因为该代码非常特定于 IIS,而不是通用的“unc 连接测试代码”。但是,整个实现都位于此处,因此您可以通过使用 Reflector 查看它来真正了解它在做什么,并且 1)使用您自己的代码重现它,或 2)使用反射机制调用它。输入 PropertyBag 中必须包含的内容可以通过查看方法(和子方法)主体来确定。
If you search a bit with .NET Reflector, you will find that the code behind this dialog is located in the
Microsoft.Web.Management.Iis.dll
assembly. This assembly is located in the GAC (if you use Reflector, just do File / Open Global Assembly Cache, and choose this DLL).To be more precise, the code is implemented in a the
Microsoft.Web.Management.Iis.WebObjects.WebObjectsTestConnectionHelper
class, methodpublic PropertyBag TestConnection(PropertyBag bag)
.Unfortunately this class is non public, as the code is quite specific to IIS, and not a general "unc connection testing code". However, the whole implementation is located here, so you can really understand what it's doing by looking at it using Reflector and 1) reproduce it using your own code, or 2) call it using reflection mechanisms. What must be in the input PropertyBag can be determined by looking at the method (and sub methods) body.