Basic LDAP Filter Syntax and Operators

  • 28 May, 2013

LDAP filters consist of one or more criteria. If one than more criterion exist in one filter definition, they can be concatenated by logical AND or OR operators.

AND Operation:
(& (…K1…) (…K2…)) or with more than two criteria:(&(…K1…)(…K2…)(…K3…)(…K4…))

OR Operation:
(| (…K1…)(…K2…)) or with more than two criteria:(|(…K1…)(…K2…)(…K3…)(…K4…))

Nested Operation:

Every AND/OR operation can also be understood as a single criterion:

(|(& (…K1…)(…K2…))(&(…K3…)(…K4…))) means:(K1 AND K2) OR (K3 AND K4)

The search criteria consist of a requirement for an LDAP attribute, e.g. (givenName=Sandra). Following rules should be considered:

Equality:         (attribute=abc)      , e.g. (&(objectclass=user)(displayName=Foeckeler)
Negation:         (!(attribute=abc))   , e.g. (!objectClass=group)
Presence:         (attribute=*)        , e.g. (mailNickName=*)
Absence:         (!(attribute=*))     , e.g. (!proxyAddresses=*)
Greater than:         (attribute>=abc) , e.g. (mdbStorageQuota>=100000)
Less than:         (attribute<=abc)     , e.g. (mdbStorageQuota<=100000)
Proximity:         (attribute~=abc)     , e.g. (displayName~=Foeckeler) Caution: ~= is treated as = in ADS environments !!
Wildcards:         e.g. (sn=F*) or (mail=*@cerrotorre.de) or (givenName=*Paul*)

More information

Related Posts

Migrating messages from Domino to Google using IMAP

  • 20 Feb, 2022

It's only for messages. No calendar migration Imapsync command is a tool allowing incremental and recursive imap transfers from one mailbox to another. If you don't understand the previous sentence,

Migrating messages from Domino to Google using IMAPRead More

Domino V12 and Verse 2.1 How to add a Photo URL

  • 08 Jun, 2021

Today i setup a Domino V12 server just for test some new features. A customer ask to use photos on Verse hosting photos on Domino. Domino V12 comes with Verse 2.0. I just download the version 2.1 of

Domino V12 and Verse 2.1 How to add a Photo URLRead More

Notes / Domino is forever

  • 04 Feb, 2021

Yesterday it seemed like it would be an ordinary working day but a client called me informing about the expiration of a certifier. It would be normal to resolve the problem with the re-certification p

Notes / Domino is foreverRead More