【问题标题】:How to get the device where some AD user locked his account in C#如何获取某些 AD 用户在 C# 中锁定其帐户的设备
【发布时间】:2018-04-19 08:26:19
【问题描述】:

我如何知道 AD 用户在哪个设备上锁定了他的帐户?有时,用户登录到多个设备。因此,要找出始终锁定帐户的设备并不容易。

当用户锁定他的帐户时,我已经读出了时间。见下文:

using (PrincipalContext pc_context = new PrincipalContext(ContextType.Domain, "domain", "someUser", "somePassword"))
{
    UserPrincipal user = new UserPrincipal(pc_context);
    PrincipalSearcher search = new PrincipalSearcher(user);
    user.SamAccountName = samAccountName;
    UserPrincipal resultUser = search.FindOne() as UserPrincipal;
}

有了这个属性:

resultUser.LastBadPasswordAttempt

我知道用户锁定他的帐户的时间。但是我怎样才能知道发生在哪个设备上?

【问题讨论】:

  • 我认为 AD 不会保留此信息。
  • @Damien_The_Unbeliever 我还能怎么做?

标签: c# active-directory


【解决方案1】:

它在锁定帐户的域控制器的事件查看器中。查看安全事件。你有它发生的时间,所以你可以寻找当时的事件。锁定帐户的事件 ID 是 4740,因此您也可以按此过滤。

更多信息在这里:https://docs.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4740

如果您的域有多个域控制器,则必须查看每个域的事件。

【讨论】:

    猜你喜欢
    • 2020-03-29
    • 2019-02-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-31
    相关资源
    最近更新 更多