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?
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.