【发布时间】:2011-02-02 01:02:14
【问题描述】:
我目前正在尝试使用 PrincipalContext 类通过 Active Directory 服务进行身份验证。我想让我的应用程序使用 Sealed 和 SSL 上下文对域进行身份验证。为此,我必须使用the following constructor of PrincipalContext (link to MSDN page):
public PrincipalContext(
ContextType contextType,
string name,
string container,
ContextOptions options
)
具体来说,我是这样使用构造函数的:
PrincipalContext domainContext = new PrincipalContext(
ContextType.Domain,
domain,
container,
ContextOptions.Sealing | ContextOptions.SecureSocketLayer);
MSDN 谈到“容器”:
商店中用作的容器 上下文的根。所有查询 在此根下执行,并且所有 插入到这个 容器。对于域和 ApplicationDirectory 上下文类型, 这个参数是有区别的 容器对象的名称 (DN)。
容器对象的 DN 是什么?如何找出我的容器对象是什么?我可以为此查询 Active Directory(或 LDAP)服务器吗?
【问题讨论】:
标签: c# .net-3.5 active-directory directoryservices