检查的用户密码有效期,当密码过期在活动猪病 [英] Checking validity of the user password when the password is expired in Active direcory

查看:276
本文介绍了检查的用户密码有效期,当密码过期在活动猪病的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作在这样一个场景,用户密码已经过期在Active Directory中。我试图检查用户输入有效的用户名和相应有效,但已过期的密码或者没有。如果用户输入有效的用户名和正确的密码过期,我将它们重定向到一个页面,在这里,他们可以重新设置密码。但是,如果用户输入错误的密码过期,那么用户应该用标准的消息通知用户名和密码,或不正确。我查了网上和他们谈论使用 validatecredentials 设置方法后的pwdLastSet -1以禁用用户下次登录时须更改密码。

I’m working in a scenario where the user password is already expired in Active Directory. I’m trying to check if the user has entered the valid username and corresponding valid but expired password or not. If the user enters the valid user name and correct expired password, I’ll be redirecting them to a page where they can reset the password. However, if the user enters wrong expired password, then the user should be notified with standard message UserName and or password is not correct. I checked online and they are talking about using validatecredentials method after setting pwdLastSet to -1 to disable user must change password at next logon.

<一个href="http://stackoverflow.com/questions/8975118/how-to-check-ad-user-credentials-when-the-user-password-is-expired-or-user-must">How检查AD用户凭据,当用户密码已过期或QUOT;用户下次登录时须&QUOT更改密码;

请问这种方法可以让我来检查过期密码的有效期是多久?我试过这种方法,它似乎并没有为我工作。

Will this approach allows me to check the validity of the expired password? I tried this approach and it does not seem to be working for me.

推荐答案

是啊 - 的ValidateCredentials API给太多的误报

Yup - the ValidateCredentials API gives too many false positives.

这是是黑色艺术,但你可以检查的用户帐户控制属性并的 MS-DS-用户帐户控制计算的属性双方已密码过期位。

This is something of a black art but you can check User-Account-Control attribute and ms-DS-User-Account-Control-Computed attribute both of which have "Password Expired" bits.

我通常使用上述但有些人建议直接使用Windows API - 参见<一href="http://stackoverflow.com/questions/1394025/active-directory-ldap-check-account-locked-out-password-expired">Active目录(LDAP) - 检查帐户锁定/密码过期

I normally use the above but some people suggest using the Windows API directly - refer Active Directory (LDAP) - Check account locked out / Password expired.

这篇关于检查的用户密码有效期,当密码过期在活动猪病的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆