LDAP服务器不可用 [英] The LDAP server is unavailable
问题描述
我是一个新手,总该
试图用 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"
这篇关于LDAP服务器不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!