且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

强制本地用户在用C#下次登录时更改密码

更新时间:2021-07-16 08:13:43

有关WINNT,必须将值设置为1,而不是0,属性名称是PasswordExpired而不是的pwdLastSet看http://msdn.microsoft.com/en-us/library/aa746542(VS.85).aspx

For WinNT, you must set the value to 1 rather than 0, and the property name is "PasswordExpired" rather than "pwdLastSet"; see http://msdn.microsoft.com/en-us/library/aa746542(VS.85).aspx

在换句话说,对于WINNT这样​​做:

In other words, do this for WinNT:

de.Properties["PasswordExpired"].Value = 1;

(这是混乱的,我知道,但对LDAP你需要的财产的pwdLastSet设置为0,是如何形成的不一致!)

(It is confusing, I know, but for LDAP you need to set the property "pwdLastSet" to 0. How's that for inconsistency!)