LDAP filer query to retrieve the members from particular OU

Hi Experts,

Hope everyone doing well!,

It has been long time since I posted a question in this forum.

There are multiple roles present under the OU=AppRoles,OU=Sample_Application,OU=Applications,O=data

i.e
CN=Rol2,OU=AppRoles,OU=Sample_Application,OU=Applications,O=data

CN=Role2OU=AppRoles,OU=Sample_Application,OU=Applications,O=data
and etc...

And there are several members who part of Role1 and Role2. I want to fetch all the members who part of Role1 and Role2

I tried like below,

Search base: OU=ActiveUsers,OU=Users,O=data
LDAP Filter: (&(objectClass=user)(groupMembership=CN=Rol2,OU=AppRoles,OU=Sample_Application,OU=Applications,O=data)) it will fetch the members who part of Role1

LDAP Filter: (&(objectClass=user)(groupMembership=CN=Rol2,OU=AppRoles,OU=Sample_Application,OU=Applications,O=data)(groupMembership=CN=Rol2,OU=AppRoles,OU=Sample_Application,OU=Applications,O=data))
it will fetch the members on Role1 and Role2

But there are n number of groups are there and I can't put all groupMembership in filter to get all members. There are multiple application and multiple roles for one application,


If I try like below,
Search base: OU=ActiveUsers,OU=Users,O=data
LDAP Filter: (&(objectClass=user)(groupMembership=CN=Role*,OU=AppRoles,OU=Sample_Application,OU=Applications,O=data)) or

(&(objectClass=user)(groupMembership=CN=Role*))  it returns nothing..

&(objectClass=user)(groupMembership=*)) it returns every members.

event I tried to get the securityequals in the filter but no luck...


Is there any way I can get all the members without mentioning all the groupmemberships in the filter??

Is that possible to use 'contains' wild card in LDAP filter?

Any extensible filter can returns all the members??  I tried everything but every filter options I tried were returns empty.


Any help/documentation/link help to achieve the goal will be appreciated!

Thanks!