Active Directory用户名或密码不正确

发布于 2025-01-22 15:45:00 字数 939 浏览 0 评论 0原文

使用Active Directory时,我有问题。

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

我读了很多有关广告问题的信息,但仍然没有解决方案。请帮助我看看。谢谢

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();

“

”在此处输入图像说明”

I have a problem when using Active Directory.

It's weird that my program run fine on my computer but when I copy it to another PC, this error shows up.

I read a lot about AD's issues, but still don't have solution. Please help me to take a look. Thank you

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();

Exception

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一影成城 2025-01-29 15:45:00

此错误说LDAP连接存在问题。

我有一些建议:

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

This error says that there is a problem with the ldap connection.

I have a couple of suggestions:

  1. add username and password to DirectoryEntry.
DirectoryEntry("LDAP://xxxxxxx/xxxxxx", username, password);
  1. check the connection string. you can loook here for more refernce -
    https://serverfault.com/questions/130543/how-can-i-figure-out-my-ldap-connection-string
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文