我有一個只命名爲CN = RA010-CAT-PAT-PUN的組,我如何通過使用LDAP或使用System.DirectoryServices.Protocols來獲得該組的完整名稱? 我有一個LdapConnection,如果僅使用LDAP知道其名稱/ CN,如何獲取組DistinguishedName?
public LdapConnection GetLdapConnection()
{
_ldapDirectoryIdentifier = new LdapDirectoryIdentifier(_currentDomain, _defaultPort);
return new LdapConnection(_ldapDirectoryIdentifier);
}
public void GetLdapConnectionForusers()
{
try
{
_ldapConnectionUsers = GetLdapConnection();
_ldapConnectionUsers.AuthType = AuthType.Basic;
_ldapConnectionUsers.SessionOptions.SecureSocketLayer = false;
if (_communicationSecurity == 1)
_ldapConnectionUsers.SessionOptions.VerifyServerCertificate = verifyCertificateCallBack;
NetworkCredential network = new NetworkCredential(_userName, _password);
_ldapConnectionUsers.Bind(network);
IsLdapConnectionEstabilished = true;
}
catch (Exception ex)
{
IsLdapConnectionEstabilished = false;
throw;
}
}
通過使用SearchRequest,我怎樣才能獲得該組 「RA010-CAT-PAT-名符其實的」 中的distinguishedName?
在此先感謝。
停止轉貼此問題。 – EJP