(|(&(|(objectClass=Contact)(&(objectClass=group)(!(userAccountControl:1.2.840.113556.1.4.803:=2))))(mail=*))
(&(|(objectClass=Contact)(&(objectClass=User)(!(userAccountControl:1.2.840.113556.1.4.804:=2))))(mail=*)))
Syntax
Name of Operator
| ||
Creates a filter which requires a field to have a given value.
| ||
Wildcard to represent that a field can equal anything except NULL.
| ||
Separates filters to allow other logical operators to function.
| ||
Joins filters together. All conditions in the series must be true.
| ||
Joins filters together. At least one condition in the series must be true.
| ||
Common LDAP Queries
The examples below show the most common LDAP queries. These queries are the most common queries used, and are designed to work with most directory server environments.
All objects (this may cause load problems):
All user objects that are designated as a “person”
Distribution Lists only
Public Folders only
All user objects except for ones with primary email addresses that begin with test
All user objects except for ones with primary email addresses that end with test
All user objects except for ones with primary email addresses that contain the word “test”
All user objects (users and aliases) that are designated as a “person” and all group objects (distribution lists)
All user objects that are designated as a “person”, all group objects and all contacts, except those with any value defined for extensionAttribute9:
(&(|(|(&(objectclass=user)(objectcategory=person))(objectcategory=group))(objectclass=contact))(!(extensionAttribute9=*)))
All users, but exclude disabled users:
Active Directory LDAP: All users
Active Directory LDAP: All email users (alternate)
OpenLDAP: All users
Lotus Domino LDAP: All users
Lotus Domino LDAP: All objects with a mail address defined that are designated as a “person “or “group”:
(&(|(objectclass=dominoPerson)(objectclass=dominoGroup)(objectclass=dominoServerMailInDatabase))(mail=*))
Ref: http://www.google.com/support/enterprise/static/postini/docs/admin/en/dss_admin/prep_ldap.html