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 additional data errors similar to an LDAP Java client :
[LDAP: error code 49 - 80090308: LdapErr: DSID-0C09030F, comment: AcceptSecurityContext error, data **525**, vece ]
525 – user not found
52e – invalid credentials (bad password)
530 – logon time restriction
532 – password expired
533 – account disabled
701 – account expired
773 – user must reset password