coldfusionldapcoldfusion-10distinguishedname

How do you filter on an LDAP attribute that uses the dn syntax using the ColdFusion CFLDAP tag?


Using the CFLDAP tag in ColdFusion I can successfully retrieve someone's distinguidedName and manager attributes with a filter like this:

(&(objectcategory=person)(objectclass=user)(mail=tim.test@nls.uk))

This reveals values such as these for the distinguidedName and manager attributes:

distinguishedName:
CN=Test\, Tim,OU=Dev,OU=IS,OU=Resources,OU=Staff,DC=natlib_1,DC=nls,DC=uk

manager:
CN=Test\, Sue,OU=Dev,OU=IS,OU=Resources,OU=Staff,DC=natlib_1,DC=nls,DC=uk

What I want to do next is find everyone else managed by Sue Test. The only attribute available to do this (that I can see at least) is the 'manager' attribute which has the dn syntax. Logic would suggest something like this:

(&(objectcategory=person)(objectclass=user)(manager=CN=Test\, Sue,OU=Dev,OU=IS,OU=Resources,OU=Staff,DC=natlib_1,DC=nls,DC=uk))

But nope... that returns nothing. I've spent hours Google-ing and trying all sorts of alternatives but nothing I have found so far works. So if someone could provide me with the correct value to put in the filter attribute of the ColdFusion CFLDAP tag to filter on a dn syntax LDAP attribute such as manager, I'd be eternally grateful!

(Identities changed in the included example to protect the innocent!)


Solution

  • Replace the backslash before the comma with \5c and it should work.

    Reference: https://msdn.microsoft.com/en-us/library/aa746475.aspx#SPECIAL_CHARACTERS

    Michael