Article

Johan Akerstrom's picture
article
Reads:

5189

Score:
0
0
 
Comments:

0

Using LdapConnection with Windows

Author Info

12 September 2007 - 12:46am
Submitted by: Johan Akerstrom

(View Disclaimer)

Problem

A Forum reader recently asked:

"I'm trying to get information from eDirectory in a Novell environment, using an ldapconnection. The problem is that I get an exception when I try to connect:

LdapException: (91) Connect Error

I'm certain that the host is correct and wonder if anyone have any guesses as to what the problem may be?"

And here's the response from Johann Akerstrom ...

Solution

I tried this code and it worked. This is on .net v2.

LdapConnection lc1 = new LdapConnection(ldapHost);
lc1.AuthType = AuthType.Anonymous;
lc1.Bind();
                
LdapConnection lc2 = new LdapConnection(ldapHost);
lc2.AuthType = AuthType.Basic;
lc.Credential = new System.Net.NetworkCredential("cn=admin,o=test", 
"password");

Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).

It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.




User Comments

© 2013 Novell