PrincipalContext - I cannot connect to the local openldap server

I installed the server openldap for windowsand I use the LDAPAdmindefault to connect to it:

Server=ldap://localhost:389
Base:dc=maxcrc,dc=com
UserName:cn=Manager,dc=maxcrc,dc=com
Password:secret

Now I want to use PrincipalContextto add users to my ou=People problem is that I can’t even connect to the server using PrincipalContext. I searched the Net and found many answers on how to connect to the ldap server, but none of them work for me. I get NullReferenceExceptioneither ServerNotFoundExceptionfor different combinations of the provided parameters for the PrincipalContext constructor. I thought I could use PrincipalContext as one of the following:

new PirncipalContext(ContextType.Domain,"maxcrc.com","dc=maxcrc,dc=com")

or

new PrincipalContext(ContextType.ApplicationDirectory,"localhost:389","dc=maxcrc,dc=com")

. , , , .

, , , PrincipalContext openldap?

P.S. Active Directory.

+4
1

MSDN :

System.DirectoryServices.AccountManagement , : Active Directory (AD DS), Active Directory (AD LDS) SAM (MSAM). System.DirectoryServices.AccountManagement System.DirectoryServices.

Active Directory - "" LDAP.

OpenLDAP, DirectoryEntry , System.DirectoryServices.Protocol (bare-bones LDAP).

+4

All Articles