CFLDAP Problem with Active Directory and bitwise filter on UserAccountControl
I am having a problem with CFLDAP on my production server (Coldfusion Standard Edition Version 8,0,1,195765 running on Windows 2003 using Sun Microsystems Java version 1.6.0_04) and my test server (Coldfusion Standard Edition Version 9,0,1,274733 running on Windows 2008 using Sun Microsystems Java version 1.6.0_17).
CFLDAP does not appear to be respecting the bitwise filter on the UserAccountControl field used to determine whether or not an account is enabled in Active Directory.
For instance, the following two queries should return identical results:
<cfldap action="query"
server="#server#"
name="CFLDAPResults"
start="DC=mycompany,DC=com"
filter="(&(objectclass=user)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))"
username="#ADUsername#"
password="#ADPassword#"
sort="displayName"
attributes="displayName,givenName,sn,cn,SamAccountname,mail">
<cfquery
name="SQLResults"
datasource="ADSI"
>
select * from openquery([ADSI],'<LDAP://dc=mycompany,dc=com>;(&(objectclass=user)(!(userAccountControl:1.2.840.113556.1.4.803:=2)));displayName,givenName,sn,cn,SamAccountname,mail')adsi order by displayName
</cfquery>
However, the first one returns all users regardless of whether or not the account is disabled. The second returns only those users whose accounts are not disabled (which is what I want). The first query uses CFLDAP to query the Active Directory server directly, while the second uses a linked server in SQL Server to perform the query.
Is anyone else having problems with this? I have searched around some and haven't found any mention of this issue, but the fact that it is occuring on both a Coldfusion 8 server and a Coldfusion 9 server leads me to believe it is not just a misconfiguration on my end.
Thanks,
Aaron
