linux - ldap 在已知树结构中查询 OU

标签 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 =

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

最佳答案

我可以试着帮你查询。 (memberOf=parameter) 过滤器适用于组,而不是 OU。 LDAP 查询包含三个组件:基础、过滤器和范围。如果你想要你的 OU 中的所有用户,那么你需要设置

  1. 基于 OU 的专有名称

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

  2. 过滤以仅获取用户

    (objectCategory=user)

  3. 范围到子树(如果您不想搜索目标 OU 下的 OU,则范围为 OneLevel)。

关于linux - ldap 在已知树结构中查询 OU,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13875797/

相关文章:

centos - centos如何增加磁盘大小

linux - 使用 sed 替换特定字符串

Linux:如何在运行脚本时自动打开终端

javascript - 找不到模块 'ldapjs'

ldap_search_ext : Bad search filter (-7)

sharepoint - MOSS 2007 能否与多个 LDAP/AD 存储集成?

oracle10g - 从 OS X 连接到 Vagrant box 上的 Oracle

python - 无法运行 python manage.py shell

linux - 可执行位的未知文件权限 - Linux

python - 在 RPi 3 上复制文件的奇怪脚本行为