Last post Aug 25, 2008 03:37 PM by raghu1
Aug 18, 2008 07:56 AM|chalagif|LINK
I dont undertsand how my code below doesnt work. I've read docs and forums whitout any success. All I want it s to connect to my openldap directory to grab some user informations.
The error message "The specified directory service attribute or value does not exist." apears. I'v set a connection with a tool (Ldap Browser) and it s work fine.
The code is simple, so what can I forgot ? Is the problem could be in the authentication type ?
Do U have set up an Openldap connection in ASP?
Any help welcome.
Aug 21, 2008 04:49 PM|ssg31415926|LINK
Classes in the System.DirectoryServices namespace (to which belong DirectoryEntry and DirectorySearcher) are wrappers round ADSI. ADSI offers limited ways to talk to LDAP servers. I think, for example, that you can only do simple binds. E.g. http://support.microsoft.com/kb/q251195/
You'll probably be better off with the System.DirectoryServices.Protocols namespace which uses the LDAP protocol to do its directory access. You need to do more work than with DirectoryEntry/DirectorySearcher and there aren't as many examples out there
but it should work. Start with this article: http://msdn.microsoft.com/en-us/library/bb332056.aspx
Aug 25, 2008 03:37 PM|raghu1|LINK
Looks like the problem is in the filter:
nDS.Filter = "(&(objectClass=personne)(mail=*))";
Not sure if this is a typo:
You can remove mail=*: It is possible that some accounts do not have their mail attribute set. As there is no mail filter : mail=* ; all the mail ids