【问题标题】:what does UserPrincipal.RefreshExpiredPassword() update?UserPrincipal.RefreshExpiredPassword() 更新了什么?
【发布时间】:2014-03-05 18:44:32
【问题描述】:

this 问题中所述,它将用户密码年龄重置为零,但如何?

pwLastSet 属性仍然显示旧日期。

还有其他属性吗?

将 pwLastSet 值重置为当前日期会更好吗?

【问题讨论】:

    标签: active-directory directoryservices


    【解决方案1】:

    我知道这个问题很老了,但源代码现在可用,所以你可以确切地看到它的作用。

    简而言之,它调用ADStoreCtx.UnexpircePassword(),将pwdLastSet 设置为-1。至少它现在是这样做的。谁知道它自 2014 年以来是否已更改。

    以下是相关代码:

    /// <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);
    }
    

    从这里:https://github.com/dotnet/corefx/blob/a1746a74091c4427890078eb817f7f4ee8423304/src/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreCtx.cs#L958

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-02-12
      • 2021-05-26
      • 2011-11-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-31
      相关资源
      最近更新 更多