'Active Directory The user name or password is incorrect
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();
Solution 1:[1]
This error says that there is a problem with the ldap connection.
I have a couple of suggestions:
- add username and password to
DirectoryEntry.
DirectoryEntry("LDAP://xxxxxxx/xxxxxx", username, password);
- 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
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Tal Folkman |


