【发布时间】:2017-09-14 17:01:45
【问题描述】:
我有一个仅命名为 CN=RA010-CAT-PAT-PUN 的组,如何使用 LDAP 或 System.DirectoryServices.Protocols 获得该组的专有名称? 我有一个 LdapConnection,
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-PUN”的 distinctName?
提前致谢。
【问题讨论】:
-
停止转发此问题。
标签: c# active-directory ldap directoryservices ldap-query