如何在 ldapsearch 中搜索组的用户?

How to search for users of a group in ldapsearch?

我想使用 ldapsearch 实用程序列出 AD 组的用户。

ldapsearch -x -D "cn=John Doe P789677,OU=Users,OU=Technology,OU=Head Office,OU=Accounts,OU=Production,DC=aur,DC=national,DC=com,DC=au" -w Teri3torz -H ldap://ldapaur.rux.atinel.com.nz -b OU=Groups,OU=Production,DC=rux,DC=atinel,DC=com,DC=nz "(&(objectClass=user)(memberOf=CN=ORG-Application-ContactCentre-ORG-PAC-Agent,OU=Applications,OU=ORG,OU=Groups,OU=Production,DC=rux,DC=atinel,DC=com,DC=nz))"

但我正在努力让它发挥作用。我知道组 CN=ORG-Application-ContactCentre-ORG-PAC-Agent,OU=Applications,OU=ORG,OU=Groups,OU=Production,DC=rux,DC=atinel,DC=com,DC=nz

有用户

但我不确定查询字符串,我是否在 -b 参数之后使用它。

如有任何想法,我们将不胜感激。

基地必须是用户所在的地方,根据您的过滤器的使用情况 "memberOf"。

ldapsearch -x -D "cn=John Doe P789677,OU=Users,OU=Technology,OU=Head Office,OU=Accounts,OU=Production,DC=aur,DC=national,DC=com,DC=au" -W -H ldap://ldapaur.rux.atinel.com.nz -b OU=Accounts,OU=Production,DC=aur,DC=national,DC=com,DC=au "(&(objectClass=user)(memberOf=CN=ORG-Application-ContactCentre-ORG-PAC-Agent,OU==Applications,OU=ORG,OU=Groups,OU=Production,DC=rux,DC=atinel,DC=com,DC=nz))

-吉姆