如何检查用户密码是否设置而不锁定该帐户? [英] How to check user password is set without locking that account?

查看:157
本文介绍了如何检查用户密码是否设置而不锁定该帐户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows上,我尝试使用Win API LogonUser检查当前登录的用户密码。我还获得了用户和域(使用WTSQuerySessionInformationW),之后我将这些用户名,域和空密码传递给函数LogonUser。它按我的预期工作。但我的程序是一项服务,它需要每15分钟调用一次密码。因此,如果在组策略管理中,我将策略Account Lockout ThreshHold设置为x次。如果我多次调用LogonUser函数,我的帐户将被锁定。在工作站和域环境中都会发生同样的事情。



有没有人对这个问题有任何想法?



类似的帖子不回答问题:



如何检测空密码用户 [ ^ ]



非常感谢

On Windows, I tried to check current logged in user password is checked using Win API LogonUser. I also got the user and domain (using WTSQuerySessionInformationW), after that I passed these username, domain and blank password to function LogonUser. It works as I expected. But my program is a service, and it requires calling check password every 15min. So if in Group Policy Managament, I set the policy Account Lockout ThreshHold to x times. If I call LogonUser function x times, my account is locked. The same thing happens on both workstation and domain environment.

Does anyone have any idea on this issue?

Similar Posts that don't answer question:

How to Detect Empty Password Users[^]

Thanks a lot

推荐答案

您可以从AD / LADP查询属性。我用户更改密码,设置属性。请参阅: http://msdn.microsoft.com/en -us / library / windows / desktop / ms679430(v = vs.85).aspx [ ^ ]。



因为我没有真的有你的最终目标,这可能不是解决方案,而是正确解释你的目标,因为你可能会以错误的方式解决它。但我无法想象你真的需要探测任何类型的密码。
You can query attributes from AD/LADP. I user changes password, an attribute is set. See: http://msdn.microsoft.com/en-us/library/windows/desktop/ms679430(v=vs.85).aspx[^].

As I didn't really got your final goal, this might not be the solution, but than explain your goal properly, since you might address it the wrong way. But I can't imagine any situation where you really have to probe password of any kind.


这篇关于如何检查用户密码是否设置而不锁定该帐户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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