IlludiumPu36
IlludiumPu36

Reputation: 4304

LDAP - search filter with multiple groups

I have the following filter and want to extend it to include another cn group:

$filter ="(&(cn=PATH*)(cn=*2013*))";

So that it includes &(cn=PATH*)(cn=*2013*) AND &(cn=MICR*)(cn=*2013*)

How should I do this?

Upvotes: 3

Views: 5082

Answers (1)

Fluffeh
Fluffeh

Reputation: 33502

I am pretty sure the syntax is the following:

(&(&(cn=PATH*)(cn=*2013*))(&(cn=MICR*)(cn=*2013*)))

This format would be more useful with an OR statement, meaning either both the first, or both the second as such:

(|(&(cn=PATH*)(cn=*2013*))(&(cn=MICR*)(cn=*2013*)))

Alternately if you simply want all four matched:

(&(cn=PATH*)(cn=*2013*)(cn=MICR*)(cn=*2013*))

Upvotes: 5

Related Questions