我在使用 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 连接存在问题。
我有几个建议:
DirectoryEntry
.DirectoryEntry("LDAP://xxxxxxx/xxxxxx", username, password);
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句