// ldap=OU=Employees,DC=xxxxxx,DC=yyyyyyy,DC=kkk // port = 389; string ldapPath = "LDAP://" + serverName + ":" + port + "/" + ldap; using (DirectoryEntry rootEntry = new DirectoryEntry(ldapPath)) { //username does not contain the prefix: CN=xxxxxx\ rootEntry.Username = username; rootEntry.Password = password;
object k = rootEntry.NativeObject; }
Can you tell me what am I doing wrong? I have the ADExplorer tool, and successfully connected there, without stating the server name at all ! (only domain, user and password)