Not yet rated

Problem

How do I get a query of all users in an Active Directory domain via LDAP?

Solution

The <cfldap> tag allows for easy access to LDAP (Lightweight Directory Access Protocol) services, such as Active Directory. It enables you to harness its power with little effort, other than learning the filter commands needed to communicate with it:

Detailed explanation

<cfldap action="query" name="QueryUsers" filter="(&(objectCategory=Person)(objectClass=User))" attributes="cn,displayname,memberof" start="dc=domain,dc=local" scope="subtree" sort="cn" server="#LdapServer#" username="#LdapUser#" password="#LdapPassword#">
<cfoutput query="QueryUsers">
#displayname#<br
</cfoutput>


+
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at Adobe.

Report abuse

Related recipes