Need LDAP query

Posted on 2006-03-24
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.
Question by:pearlvision
    LVL 15

    Accepted Solution

    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,


    Author Comment

    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).


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    So you have two Windows Servers and you have a directory/folder/files on one that you'd like to mirror to the other?  You don't really want to deal with DFS or a 3rd party solution like Doubletake. You can use Robocopy from the Windows Server 200…
    This may not be a text book method to resolve VSS backup issues but it seemed to have worked on few of the Windows 2003 servers we had issues while performing a Volume Shadow Copy backup. If you have issues while performing a shadow copy backup usin…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now