ldap在知道树结构中查询OU

时间:2012-12-14 09:22:39

标签: linux ldap centos

我正在Centos桌面上使用名为Itop的工具尝试两件事。

我在这里发帖是因为它是关于一般的ldap查询。我正在尝试使用ldap explore和Itop进行查询。

1.从OU中导入多个用户,但它无法正常工作。

我的ldap查询可能并不好:

(&(objectCategory=organizationalUnit)(memberOf=CN=Organizational-Unit,CN=Schema,CN=Configuration,DC=mydomain,DC=local))

(&(objectCategory=user)(memberOf=OU=Users,OU=Informatique,OU=Administration,DC=mydomain,DC=local))

知道我的树结构是这样的:

DC=mydomain,DC=local => OU=Administration => OU=Informatique, OU=Users

2.导入特定用户:

(objectcategory=user)((cn=seb))

查询正在运行,但我在Itop中出错可能是错过了一个字段: 错误:

An error occured while processing 1: Object not following integrity rules: issues = Unexpected value for attribute 'name': Null not allowed, Unexpected value for attribute 'email': Wrong format [seb@mydomain.local], class = Person, id =

如何解决?用哪些查询? 谢谢, 刚毛

1 个答案:

答案 0 :(得分:1)

我可以尝试帮助您查询。 (memberOf = 参数)过滤器适用于组,而不是OU。 LDAP查询有三个组件:base,filter和scope。如果您想要OU中的所有用户,则需要设置

  1. 基于OU的专有名称

    OU=Users,OU=Informatique,OU=Administration,DC=mydomain,DC=local

  2. 过滤以仅获取用户

    (objectCategory=user)

  3. 范围为Subtree(如果您不想在目标OU下搜索OU,则为OneLevel)。