I'm using the code below to search in our Active Directory.
I get the response:
"The authentication mechanism is unknown."
The server that is running the code is NOT a domain member.
Been searching around, but I can't find an explanation of what is causing the error.
private string LDAPConn = "LDAP://192.168.100.186";
DirectoryEntry de = new DirectoryEntry(LDAPConn, "DOMAIN\username", "password", AuthenticationTypes.Secure);
DirectorySearcher deSearcher = new DirectorySearcher(de);
deSearcher.Filter = "(&(objectClass=user))";
deSearcher.SearchScope = SearchScope.Subtree;
SearchResultCollection results = deSearcher.FindAll();
catch (Exception ex)
msg.Text += ex.Message;