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