パスワードのリセットは正常に機能し、ユーザーは新しいパスワードでログインできますが、古いパスワードは引き続き機能します。古いパスワードは 5 分後に期限切れになります。ユーザーがパスワード ポリシー グループに追加されます。set password メソッドを2回呼び出して、古いパスワードの検証を停止しようとしました。ただし、パスワードの最小有効期間を 1 日に設定したためです。このトリックは機能しません。
PrincipalContext ctx = new PrincipalContext(ContextType.Domain);
UserPrincipal user = UserPrincipal.FindByIdentity(ctx, userName);
AdUser adUser = new AdUser();
if (user != null && !string.IsNullOrEmpty(randomPassword))
{
user.SetPassword(randomPassword);
}
bool status = SPClaimsUtility.AuthenticateFormsUser(Context.Request.UrlReferrer, txtUserName.Text.Trim(), txtPassword.Text.Trim());
どんな助けでも大歓迎です。