如何使用LDAP从外部活动目录获取用户的组描述 [英] How do I get group description of a user from external active directory using LDAP

查看:80
本文介绍了如何使用LDAP从外部活动目录获取用户的组描述的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我需要在哪里获取用户所属的所有群组描述以及群组的描述用户不是其成员。

与外部域的连接必须通过LDAP与端口389和用户的凭证连接。



我尝试过:



Hi All,

I've a requirement where in I need to get all the group description of which the user is member of and also of those group's description as well whose member the user is not.
The connection to the external domain has to be trough LDAP with port 389 and with user's credential.

What I have tried:

I am able to validate the user using below code:

<pre>public string UserValidation(string username, string domain, string password, string url)
    {
        var credentials = new NetworkCredential(username, password, domain);
        var serverId = new LdapDirectoryIdentifier(url);

        LdapConnection connection = new LdapConnection(serverId, credentials);

        string result = "true";

            try
            {
                connection.Bind();
            }
            catch (Exception e)
            {
                result = e.ToString();
            }

            connection.Dispose();

            return result;

        }

推荐答案

看看这个文章。当我需要使用活动目录时,它确实帮助了我。
Have a look at this article. It really helped me when I needed to work with active directory.


这篇关于如何使用LDAP从外部活动目录获取用户的组描述的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆