我目前正在尝试使用 PrincipalContext 类通过 Active Directory 服务进行身份验证。我想让我的应用程序使用 Sealed 和 SSL 上下文对域进行身份验证。为此,我必须使用PrincipalContext 的以下构造函数(链接到 MSDN 页面):
public PrincipalContext(
ContextType contextType,
string name,
string container,
ContextOptions options
)
具体来说,我这样使用构造函数:
PrincipalContext domainContext = new PrincipalContext(
ContextType.Domain,
domain,
container,
ContextOptions.Sealing | ContextOptions.SecureSocketLayer);
MSDN 说关于“容器”:
商店中用作上下文根的容器。所有查询都在这个根目录下执行,所有插入都在这个容器中执行。对于 Domain 和 ApplicationDirectory 上下文类型,此参数是容器对象的专有名称 (DN)。
容器对象的 DN 是什么?如何找出我的容器对象是什么?我可以为此查询 Active Directory(或 LDAP)服务器吗?