LDAP服务器不可用

LDAP服务器不可用

问题描述:

我是一个新手,总该

试图用 PrincipalContext 连接到LDAP服务器。我试图在这个网站无济于事所有的解决方案。

Trying to connect to an ldap server with PrincipalContext. I have tried all solutions on this site to no avail.

事情我已经试过:

PrincipalContext insPrincipalContext = 
   new PrincipalContext(ContextType.Domain);

PrincipalContext insPrincipalContext = 
   new PrincipalContext(ContextType.Domain, "ldap://localhost:389/dc=maxcrc,dc=com");

PrincipalContext insPrincipalContext = 
   new PrincipalContext(ContextType.Domain, "maxcrc.com");

所有产生相同的结果:

All give the same result:

LDAP服务器不可用

只有 ContextType.Machine 工作基本上是这样。

Only ContextType.Machine works basically.

不知道如果我的LDAP服务器设置正确:

Not sure if my LDAP server is set up correctly:


  • 主机:本地主机

  • 端口:389

  • 基本DN:DC = maxcrc,DC = COM

  • URL:LDAP://本地主机:389 / DC = maxcrc,DC = COM

测试与Softerra的LDAP浏览器

Testing with Softerra LDAP Browser

从开始到结束任何教程将大大AP preciated ...

Any tutorials from start to finish will be much appreciated...

我有类似的问题。原来,我不得不在对象的初始化通过用户名和密码。请尝试使用如下语句如下:

I had similar issues. It turned out that I had to pass username and password in the object initialization. Please try using a statement like below:

PrincipalContext insPrincipalContext = 
new PrincipalContext(ContextType.Domain, 
"ldap://localhost:389/dc=maxcrc,dc=com",
userName,
password);

另外,还要确保您的用户名域了。

Also make sure that your username has domain in it.

例如,

userName = "mydomainname" + "\\" + "john_jacobs"