Wednesday 15 September 2010

ASP.NET Bind and Query LDAP -


So I'm trying to explain why I can not find my LDAP search to work. >

  Private string getDNFromLDAP (string string) {string string = ""; // Create an LDAP entry object directory entry entry = new directoryInterior ("LDAP: //something.blah.com/cn=people,dc=blah,dc=com"); Entry. Authentication type = authentication type Secure Sockets Layer; Entry.Username = "cn = myaccount, cn = special, dc = blah, dc = com"; Entry. Password = "over change"; DirectorySearcher mySearcher = New Directory Finder (Entry); MySearcher.SearchScope = SearchScope.Subtree; MySearcher.Filter = "(uid =" + strUID + ")"; Search Results Results = mySearcher.FindOne (); Int nIndex = result.Path.LastIndexOf ("/"); StrDN = Result Path Substring ((Nintendix + 1)) Toaster (). Trimand (); // up spaces entry. Stop it (); Entry.Dispose (); MySearcher.Dispose (); // Returns the DN Return SRDN; }   

I know that the object I'm looking for (know with confirmation with ldapsearch) is known, but my result remains empty. I suspect that there is a problem with the base DN, but I do not know what directory search is using as the basis DN. Any help at all will be appreciated.

You have set the route using the search property. The root is set to the entry that you pass on the constructor, so it can be that you can not get your entry.

No comments:

Post a Comment