【发布时间】:2011-02-07 06:47:19
【问题描述】:
我需要获取 IIS 中可用的 i Web 应用程序的身份验证提供程序状态吗?
例如:
基本身份验证可用于 X 站点吗? 通过c#或python代码
【问题讨论】:
标签: sharepoint iis authentication provider
我需要获取 IIS 中可用的 i Web 应用程序的身份验证提供程序状态吗?
例如:
基本身份验证可用于 X 站点吗? 通过c#或python代码
【问题讨论】:
标签: sharepoint iis authentication provider
尝试使用这样的代码:
using (SPSite site = new SPSite("site_url_here"))
{
var webApp = site.WebApplication;
var customZoneSettings = webApp.IisSettings[Microsoft.SharePoint.Administration.SPUrlZone.Custom];
bool useBasicForCustomZone = customZoneSettings.UseBasicAuthentication;
}
在这里,您可以获得指定站点的父 SPWebApplication 并查找指定区域的 IisSettings(因为不同区域可能有不同的设置)。 SPIisSettings 对象包含许多有助于完成任务的属性,例如 UseBasicAuthentication。
【讨论】: