【问题标题】:LDAP Query to get all objects that are of objectCategory user or decend from userLDAP 查询以获取属于 objectCategory 用户或来自用户的所有对象
【发布时间】:2019-08-09 19:37:03
【问题描述】:

我正在尝试查找一个 objectCategory 查询,该查询将返回我的活动目录中的所有“用户”。

我认为这就像(objectCategory=user) 一样简单。虽然这确实返回了我的大部分用户,但并没有返回所有用户。

我的 Active Directory 中有一些组托管服务帐户 (gMSA)。它们具有 msDS-GroupManagedServiceAccount 的 objectCategory。当我查找msDS-GroupManagedServiceAccount 时,它表明它具有派生自user 的字段。

这让我相信 msDS-GroupManagedServiceAccountuser 的子类。这引出了我的问题:

有没有办法表明我想要 objectCategory user 的所有对象以及 objectCategory user 的所有对象?

【问题讨论】:

  • 你能用objectClass匹配吗?这会起作用,因为所有父类也都存在。

标签: active-directory ldap ldap-query


【解决方案1】:

搜索 objectClass 而不是 objectCategory

(objectClass=user)

objectClass 属性开始在 Windows Server 2008 中建立索引,因此只要您运行的是 2008+,它的速度将与通过 objectCategory 搜索一样快。

【讨论】:

    【解决方案2】:

    不是对您的粗体问题的完整答案,但针对您的特定情况的解决方法是使用 or 表达式。

    (|(objectCategory=person)(objectCategory=msDS-GroupManagedServiceAccount))

    【讨论】:

      猜你喜欢
      • 2020-05-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多