I have the following code to verify a Active Directory user(VS2008 on Win7).
try
{
PrincipalContext pc = new PrincipalContext(ContextType.Domain, strDomainName))
isPass = pc.ValidateCredentials(strDomainUserName, strDomainUserPass);
}
catch (Exception ex)
{
Logger.Log("authentiate domain user fail: {0},{1}", ex.ToString(), strDomainUserLoginName);
}
For some AD user, it is OK, but for a AD user, I will get the following exception:
System.DirectoryServices.Protocols.DirectoryOperationException:
The server cannot handle directory requests.
System.DirectoryServices.Protocols.ErrorChecking.CheckAndSetLdapError(Int32 error)
System.DirectoryServices.Protocols.LdapSessionOptions.FastConcurrentBind()
System.DirectoryServices.AccountManagement.CredentialValidator.BindLdap(NetworkCredential creds, ContextOptions contextOptions)
System.DirectoryServices.AccountManagement.CredentialValidator.Validate(String userName, String password)
System.DirectoryServices.AccountManagement.PrincipalContext.ValidateCredentials(String userName, String password)
So does Active Directory Domain user setting will cause such a exception?