How can I get an Active Directory data code from System.DirectoryServices[.Protocols]?
- by Alex Waddell
When using .Protocols, I can run the following pseudocode to authenticate to an AD:
try
{
LdapConnection c = new LdapConnection("User", "Password");
c.Bind();
}
catch (LdapException le)
{
Debug.WriteLine(le.ResultCode);
}
This code will allow me to get the "Invalid Credentials" error string, and the AD code "49", but I need to get the…