Link to home
Start Free TrialLog in
Avatar of albuitra
albuitraFlag for Colombia

asked on

Get Distinguished Name from C#

Hi Folks,
I need to find the Distinguished Name of an LDAP for any user using c#
I only have the IP and PORT
is there any function for this ?

thanks
Avatar of YourReference
YourReference
Flag of Canada image

Avatar of albuitra

ASKER

Thanks for the link
But it is oriented to active domain
case objectClass.user:
            mySearcher.Filter = "(&(objectClass=user)
        (|(cn=" + objectName + ")(sAMAccountName=" + objectName + ")))";
            break;
        case objectClass.group:
            mySearcher.Filter = "(&(objectClass=group)
        (|(cn=" + objectName + ")(dn=" + objectName + ")))";
            break;
        case objectClass.computer:
            mySearcher.Filter = "(&(objectClass=computer)
            (|(cn=" + objectName + ")(dn=" + objectName + ")))";
            break;


how can I do the same for any LDAP (linux, sun, ibm, oracle ) server ?
ASKER CERTIFIED SOLUTION
Avatar of Alexandre Simões
Alexandre Simões
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial