Hello all,
i'va have a issue with one user when he want to validate his credentials, with all others it works. Here the method
str userName = System.Environment::get_UserName(),
userDomain = System.Environment::get_UserDomainName();
System.DirectoryServices.AccountManagement.PrincipalContext pc;
;
dfUser = d.addFieldValue(extendedTypeStr(UserIdStr), strFmt(@"%1\%2", userDomain, userName));
dfPass = d.addFieldValue(extendedTypeStr(password),"");
dfUser.enabled(false);
dfPass.passwordStyle(true);
if (d.run())
{
pc = new System.DirectoryServices.AccountManagement.PrincipalContext(
System.DirectoryServices.AccountManagement.ContextType::Domain,
userDomain
);
//Invalid Password
if(!pc.ValidateCredentials(userName, dfPass.value())) return checkFailed("@EVE4195");
return true;
}
I don't know how to retrieve any exception, only returns false.
I did a Tester with C# with the same code and it work's.
Thanks in advance!