C#ActiveDirectory UserPrincipal.SetPassword()忽略密码策略中的密码历史记录 [英] C# ActiveDirectory UserPrincipal.SetPassword() ignores password history in password policy

查看:326
本文介绍了C#ActiveDirectory UserPrincipal.SetPassword()忽略密码策略中的密码历史记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨。



我正在开发一个用于活动目录操作的库,如身份验证,创建用户,删除用户,启用/禁用用户和更改密码。



我的图书馆工作正常,除了一些错误。



问题#1。什么时候我打电话给...

Hi.

I am developing a library for active directory operations like authentication, create user, delete user, enable/disable user and change password.

My library works fair except a few bugs.

Issue #1. When I call...

UserPrincipal.SetPassword(somePassword);

...即使我在 Enfore密码时尝试使用以前的密码,也只需设置密码历史记录政策设置为值记住9个密码。当此策略处于活动状态时,我的密码更改代码将失败,因为它是最近使用的密码更改代码。但我的代码只是设置了新密码。关于如何解决此问题的任何想法?



问题#2。当我设置密码时,如果复杂性要求是密码则拒绝密码没见过。是否有任何想法来检索活动密码策略设置,以便我可以向最终用户显示友好消息?

...the password is simply set even if I try with the previous password when the Enfore Password History policy is set with a value 9 passwords remembered. When this policy is active, my password change code is expected to fail because it is a recently used one. But my code simply sets the new password. Any idea about how to fix this?

Issue #2. When I set a password, the password is rejected if the complexity requirement is not met. Is there any idea to retrieve the active password policy settings so that I can display a friendly message to the end user?

推荐答案

这可以帮助您。



http://www.c-sharpcorner.com/uploadfile/f9935e/password-policystrength-asp-net-validator-web-control/ [ ^ ] [ ]
May this help you.

http://www.c-sharpcorner.com/uploadfile/f9935e/password-policystrength-asp-net-validator-web-control/[^][]


这篇关于C#ActiveDirectory UserPrincipal.SetPassword()忽略密码策略中的密码历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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