I am looking to connect and retrieve data from ldap data source other than Active Directory. I tried using DirectoryEntry but its meant for Active Directory objects and so doesn't seem to work with others. Are there any other options in c# to connect and fetch data from ldap sources?
Asked
Active
Viewed 257 times
1 Answers
0
DirectoryEntry de = new DirectoryEntry(LDAP://127.0.0.1/CN=Users,dc=test,dc=com", UserName, Password, AuthenticationTypes.Secure);
DirectorySearcher ds = new DirectorySearcher(de);
ds.FindOne();
1. Replace "127.0.0.1" by your IP. 2. UserName= LDAP User Name 3. Passwoed =LDAP User Password. 4. DC(Domain Component)= your domain component 5. CN (Common Name) = your Common Name This code works for me to connect LDAP server.

Community
- 1
- 1

Ashiquzzaman
- 5,129
- 3
- 27
- 38