User Guide

Table Of Contents
Querying an LDAP directory 521
The following table lists the attributes that are required and optional for each action. For more
information on each attribute, see the
cfldap tag in CFML Reference.
Querying an LDAP directory
The cfldap tag lets you search an LDAP directory. The tag returns a ColdFusion query object
with the results, which you can use as you would any query result. When you query an LDAP
directory, you specify the directory entry where the search starts and the attributes whose values to
return. You can specify the search scope and attribute content filtering rules and use other
attributes to further control the search.
Scope
The search scope sets the limits of a search. The default scope is the level below the distinguished
name specified in the
start attribute. This scope does not include the entry identified by the
start attribute. For example, if the start attribute is “ou=support, o=macromedia” the level
below support is searched. You can restrict a query to the level of the
start entry, or extend it to
the entire subtree below the
start entry.
Search filter
The search filter syntax has the form attribute operator value. The default filter, objectclass=*,
returns all entries in the scope.
The following table lists the filter operators:
Action Required attributes Optional attributes
query server, name, start,
attributes
port, username, password, timeout, secure, rebind,
referral, scope, filter, sort, sortControl startRow,
maxRows, separator, delimiter
add server, dn, attributes port, username, password, timeout, secure, rebind,
referral, separator, delimiter
modify server, dn, attributes port, username, password, timeout, secure, rebind,
referral, modifyType, separator, delimiter
modifyDN server, dn, attributes port, username, password, timeout, secure, rebind,
referral
delete server, dn port, username, password, timeout, secure, rebind,
referral
Operator Example Matches
=* (mail=*) All entries that contain a mail attribute.
= (o=macromedia) Entries in which the organization name is macromedia.
~= (sn~=Hansen) Entries with a surname that approximates Hansen. The
matching rules for approximate matches vary among directory
vendors, but anything that “sounds like” the search string
should be matched. In this example, the directory server might
return entries with the surnames Hansen and Hanson.