问题描述
如问题中所述,它将用户密码年龄重置为零,但是如何?pwLastSet属性仍然显示旧日期。
还有其他属性吗?
将pwLastSet值重置为当前日期更好吗?
我知道这个问题很旧,但是源代码现在可用,因此您可以确切地看到它的作用。
简而言之,它调用 ADStoreCtx.UnexpircePassword()
,它会设置 pwdLastSet
至-1。至少现在是这样。谁知道自2014年以来是否已更改。
以下是相关代码:
///< summary>
///通过将pwdLastSet设置为-1来取消密码
///< / summary>
///< param name = p>< / param>
内部重写void UnexpirePassword(AuthenticablePrincipal p)
{
GlobalDebug.WriteLineIf(GlobalDebug.Info, ADStoreCtx, UnexpirePassword);
Debug.Assert(p.fakePrincipal == false);
WriteAttribute(p, pwdLastSet,-1);
}
从此处:
as noted in this question, it resets the users password age to zero, but how?
pwLastSet attribute still displays the old date.
Is there another attribute?
Is it better to just reset pwLastSet value to current date?
I know this question is old, but the source code is available now, so you can see exactly what it does.
In short, it calls ADStoreCtx.UnexpircePassword()
, which sets pwdLastSet
to -1. At least that's what it does now. Who knows if it's been changed since 2014.
Here's the relevant code:
/// <summary>
/// Unexpire password by setting pwdLastSet to -1
/// </summary>
/// <param name="p"></param>
internal override void UnexpirePassword(AuthenticablePrincipal p)
{
GlobalDebug.WriteLineIf(GlobalDebug.Info, "ADStoreCtx", "UnexpirePassword");
Debug.Assert(p.fakePrincipal == false);
WriteAttribute(p, "pwdLastSet", -1);
}
这篇关于UserPrincipal.RefreshExpiredPassword()更新什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!