We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now


Need LDAP query

pearlvision asked
Medium Priority
Last Modified: 2012-08-14
I am looking to see if anyone can write a custom LDAP query for me to use in ADUC for 2003 saved queries. I am trying to generate this list from AD: I want to find all users that have the PO Box Field present (populated), but I do not want to include disabled accounts. We use this field for Siebel users and it is the only thing in AD that differentiates these users from non Siebel users.

I have only played with the saved queries in ADUC and not found a good way to combine the 2 criteria using the interface options. Thus I thought a custom LDAP query would work. If you can provide this or show me how I can do it in the interface using the basic features, you can have 500 points!  Thanks.
Watch Question

In ADUC create a new query and name it.
Then select define query and select "Custom search".
On the advanced tab create the query.
This should be something like:
Klik OK and OK and there should it be.
The ldap query is case sensitive.

Some LDAP reading.

Good luck,


Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts


Thanks for the comment. Did not need the step by step, but I am going to give you the points as you pointed me in the right direction and I found the syntax you referenced on the right page. After looking around I found the query that works is (&(objectCategory=user)(postOfficeBox=*))(!userAccountControl:1.2.840.113556.1.4.803:=2).

Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.