Active Directory The user name or password is incorrect

Viewed 278

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

1 Answers
Related