Active Directory 用户名或密码不正确

黎氏灵

我在使用 Active Directory 时遇到问题。

奇怪的是我的程序在我的计算机上运行良好,但是当我将它复制到另一台 PC 时,出现了这个错误。

我读了很多关于 AD 的问题,但仍然没有解决方案。请帮我看看。谢谢

string LDAPPath = "LDAP://xxxxxxx/xxxxxx"; // Sorry I can't show it here

DirectoryEntry entry = new DirectoryEntry(LDAPPath);

DirectorySearcher mySearcher = new DirectorySearcher(entry);

mySearcher.Filter = string.Format("(&(objectClass=group)(sAMAccountName=*))");
mySearcher.PageSize = 5000;

mySearcher.PropertiesToLoad.Add("member");
mySearcher.PropertiesToLoad.Add("name");

SearchResultCollection mysrs = mySearcher.FindAll();

例外

在此处输入图像描述

塔尔·福克曼

此错误表示 ldap 连接存在问题。

我有几个建议:

  1. 将用户名和密码添加到DirectoryEntry.
DirectoryEntry("LDAP://xxxxxxx/xxxxxx", username, password);
  1. 检查连接字符串。您可以在这里查看更多参考 - https://serverfault.com/questions/130543/how-can-i-figure-out-my-ldap-connection-string

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

使用用户名使用UnboundID对Active Directory用户进行身份验证

Kubernetes Cockpit用户名和密码不正确

使用电子邮件ID从Active Directory查找用户名

从Active Directory获取用户名

无需用户名和密码即可使用Java连接到LDAP Active Directory

如何在Windows Powershell中获取Azure Active Directory用户名?

从Azure Active Directory授权用户

计算Active Directory用户

从Active Directory删除VSTS用户

Active Directory / Powershell中名称和/或用户名的部分/接近匹配

从Active Directory获取当前登录的用户名?

为什么用户名在我的Active Directory密码过滤器DLL中以$结尾?

未使用长用户名对Active Directory / LDPA进行身份验证

Powershell Active Directory用户名

Active Directory用户列表

Active Directory用户的家园

如何使用用户名和密码访问Active Directory上的用户文件夹?

检查Microsoft Azure Active Directory中是否存在用户名

如何从Java获取Active Directory用户密码

如何在Active Directory中获取用户名并在Windows Services中使用它?

使用PrincipalContext在LDAP(Active Directory)中搜索所有用户名及其信息

Yahoo用户名或密码不正确?

Active Directory密码重置

“用户名和密码不正确”尽管正确?

Samba 使用 Active Directory 用户

使用以下条件检查 Active Directory 用户名是否存在

使用 Active Directory 创建用户

使用 Active Directory 对用户进行身份验证,而不会在 catch 块中放置不正确的用户名或密码错误

C# Active Directory - 用户名和密码不正确,但详细信息实际上是正确的