Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CFLDAP Filter by OU

Guest
Feb 04, 2009 Feb 04, 2009
Hello,

I have this CFLDAP query that returns all of the users in my AD from every OU but excluding disabled accounts. It works fine...

However what I would like to do is return all of the users from a particular OU only, i`m sure i need to do this in the filter attribute but I cant figure it out. I have three OU`s. I only want to query the users in my "People" OU. Any ideas how I specify this?

Here is my code.
Thanks.

<cfldap action="QUERY"
name="results"
attributes="userPrincipalName,description,physicalDeliveryOfficeName"
start="dc=domain,dc=com
scope="SUBTREE"
filter="(&(objectCategory=user)(userPrincipalName=*)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))"
server="server.domain"
username="********"
password="********">

<cfdump var="#results#">



TOPICS
Advanced techniques
1.6K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Deleted User
Feb 05, 2009 Feb 05, 2009
Ive solved it.

I placed "OU=Peoplae" in the "start" attribute, here...

start="ou=People,dc=redditch,dc=vd,dc=valeo"

I did try taking out the other gibberish like you suggested but still it didnt return anythng, strange becuase it really should have.

Thanks your your help.
Translate
Engaged ,
Feb 04, 2009 Feb 04, 2009
Doesn't this work?

filter = "OU=people"
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 04, 2009 Feb 04, 2009
No, I tried it like this.....

filter=(&(objectCategory=user)(OU=People)(userPrincipalName=*)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))"

I`m really not sure if i`m putting "OU=People" in the right place and I dont know if the syntax is correct.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 04, 2009 Feb 04, 2009
Take out the other gibberish.

Replace this:
filter=(&(objectCategory=user)(OU=People)(userPrincipalName=*)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))"

With this:
filter = "OU=people"

Do you get anything back?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 05, 2009 Feb 05, 2009
Ive solved it.

I placed "OU=Peoplae" in the "start" attribute, here...

start="ou=People,dc=redditch,dc=vd,dc=valeo"

I did try taking out the other gibberish like you suggested but still it didnt return anythng, strange becuase it really should have.

Thanks your your help.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 05, 2009 Feb 05, 2009
LATEST
Ive solved it.

I placed "OU=Peoplae" in the "start" attribute, here...

start="ou=People,dc=redditch,dc=vd,dc=valeo"

I did try taking out the other gibberish like you suggested but still it didnt return anythng, strange becuase it really should have.

Thanks your your help.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources