[英]LDAP Python - Search for users which are members of a group in nested OUs
I am trying the search command below in Python using the LDAP library with no luck. 我正在使用LDAP库在Python中尝试以下搜索命令,但没有成功。
conn.search('dc=int,dc=xyz,dc=com'.format(domain_name), '("(&(objectClass=user)(memberOf:1.2.840.113556.1.4.1941:=CN=Project Share,OU=Management,OU=Support,OU=Region 1))', attributes=[ALL_ATTRIBUTES, ALL_OPERATIONAL_ATTRIBUTES])
My AD tree is as follows: 我的广告树如下:
int.xyz.com (domain)
|____Region 1 (OU)
|____Support (OU)
|____ Management (OU)
|____User1 (Member of Project Share)
|____User2 (Member of Leaders Share)
|____User3 (Member of Project Share)
Results must show attributes of User1 and User3 结果必须显示User1和User3的属性
Getting error: 出现错误:
ldap3.core.exceptions.LDAPInvalidFilterError: invalid filter
ldap3.core.exceptions.LDAPInvalidFilterError:无效的过滤器
看起来您在过滤器中有一个错字,应该是:
'(&(objectClass=user)(memberOf:1.2.840.113556.1.4.1941:=CN=Project Share,OU=Management,OU=Support,OU=Region 1))'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.