Skip to main content
Rodrigo Alarcon
Known Participant
September 14, 2009
Question

cfldap query

  • September 14, 2009
  • 1 reply
  • 841 views

Hello ppl, it's been a very long time since i last posted here, ne way, i hope i can get some help from you guys.

This time i'm posting here because i'm having some issues with cfldap.

So far i have this:

<cfldap username="some_user"
  password="some_password"
  server="dc.mynetwork.com" 
  action="query"
  name="LdapAreaQuery"
  start="dc=mynetwork,dc=com"
  filter="(&(objectclass=organizationalunit)(!(|(name=computers)(name=groups)(name=servers))))"
  attributes="ou"
  sort="ou"
  timeout="20000">

<cfquery name="FilterLDAP" dbtype="query">
    SELECT DISTINCT(ou)
  FROM LdapAreaQuery

</cfquery>

So far i'm using FilterLDAP to populate a cfselect (used as a filter) with all the Organizational Units that are not computers, groups or servers, the thing is that i'm getting this cfselect populated with sub-ou, for example: OU=Support,OU=IT,DC=mynetwork,dc=com the thing is that i ONLY need the 1st level of the OU not the whole thing (what i need is OU=IT,DC=mynetwork,dc=com)

TY in advance!

This topic has been closed for replies.

1 reply

ilssac
Inspiring
September 15, 2009

First suggestion.  Make your start more specific.  If you only want "OU-IT,DC=mynetwork,DC=com".  Put all that in your start parameter.

Secondly play with the scope parameter which can have the following parameters,:

  • oneLevel: entries one level below entry.
  • base: only the entry.
  • subtree: entry and all levels below it.