Hello. I have LDAP groups which keep users inside. Here an example of group:
# developer, roles, domain.com dn: cn=developer,ou=roles,dc=domain,dc=com objectClass: organizationalRole cn: developer roleOccupant: uid=user1,ou=people,dc=domain,dc=com roleOccupant: uid=user2,ou=people,dc=domain,dc=com
I need to make a search filter, which can say, if certain user belong to group? Or does certain group have a user?
Next filter give all uids of group developer:
openldapsearch -v -H ldaps://<ldap_host> -x -b 'dc=domain,dc=com' -W -D "cn=vmail,ou=services,dc=domain,dc=com" '(&(objectClass=organizationalRole)(cn=developer))' RoleOccupant
When I try to add 'uid' to filter it doesn't return any records:
'(&(objectClass=organizationalRole)(cn=developer)(uid=user1,ou=people,dc=domain,dc=com))' RoleOccupant '(&(objectClass=organizationalRole)(cn=developer)(uid=user1,ou=people,dc=domain,dc=com))' '(&(objectClass=organizationalRole)(cn=developer)(uid=user1*))' RoleOccupant
How I can change filter, that check if user1 belong to group developer?