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();
This error says that there is a problem with the ldap connection.
I have a couple of suggestions:
DirectoryEntry
.DirectoryEntry("LDAP://xxxxxxx/xxxxxx", username, password);