Can you help me with creating a search string in AD

Discussion in 'Active Directory' started by rob davis, Feb 23, 2008.

  1. rob davis

    rob davis Guest

    I Need to All User accounts (located in the Users container in AD... an
    produce a list

    stating their user account, smtp account, and any secondary smtp accounts
    assigned to them

    thank you.
    rob davis, Feb 23, 2008
    1. Advertisements

  2. rob davis

    Rog Guest


    Here is a site that can give you a lot of guidance to creating AD queries to
    solve your problem. At the bottom of the page is a zip file that you can
    download with a bunch of xml files configured with popular queries needed in

    You can take those and modify to get the result you are looking for and then
    import in DSA (AD users and computers)

    If you are unfamilar with how to import the XML, then this link will help
    you with that as well.

    Hope this helps.
    Rog, Feb 23, 2008
    1. Advertisements

  3. I have tips on using ADO in a VBScript program to search AD linked here:

    For example, to retrieve sAMAccountName (NT name of user, also called
    "pre-Windows 2000 logon name"), mail (email address), and proxyAddresses
    (multi-valued attribute with email addresses) of users in Users container,
    you could use:

    strBase = "cn=Users,dc=MyDomain,dc=com"
    strAttributes = "sAMAccountName,mail,proxyAddresses"
    strFilter = "(&(objectCategory=person)(objectClass=user))"

    The multi-valued attribute must be enumerated, as explained in the link:

    The filter clause can be used with many command line tools, like Joe
    Richards' adfind or dsquery. They can even be used in ADUC as saved queries
    or with Find option.
    Richard Mueller [MVP], Feb 23, 2008
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.