dsquery to list users with ending with @domain.com

Discussion in 'Windows Server' started by guzzi, Mar 3, 2006.

  1. guzzi

    guzzi Guest

    Can't figure out how should DSQUERY looks like to do it
    Want it to make a TXT file withh all that data

    It is the same like Advanced Find
    Field User
    Condition list:
    Proxy Addresses | Ends with | @domain.com

    Thank you in advance
     
    guzzi, Mar 3, 2006
    #1
    1. Advertisements

  2. guzzi

    guzzi Guest

    This gives me all SMTP addresses:

    dsquery * forestroot -scope subtree -filter
    "(&(mail=*)(proxyaddresses=smtp:*))" -attr proxyaddresses

    For this example, the search pattern is *SMTP:_*@*. This search pattern
    captures every SMTP (Internet Mail) Exchange e-mail proxy address that
    starts with an underscore.

    ldifde -f badproxies.txt -d "dc=domain,dc=com" -l proxyaddresses -r
    "(proxyaddresses=*smtp:_*@*)"

    using "(proxyaddresses=*smtp:*@domain.com)" - exports me all addresses
    like when i use "(proxyaddresses=*smtp:*@*)"

    What is wrong?
     
    guzzi, Mar 3, 2006
    #2
    1. Advertisements

  3. C:\>dsquery * domainroot -filter "(&(objectCategory=Person)(objectClass=User)(userPrincipalName=*@Domain.com))" -attr distinguishedName sAMAccountName userprincipalName -limit 0

    Add any attributes you want. See tip 7714 ยป What attribute names can I use with the user filtered dsquery command? 30-Jan-04
    in the 'Tips & Tricks' at http://www.jsifaq.com

    Jerold Schulman
    Windows Server MVP
    JSI, Inc.
    http://www.jsiinc.com
    http://www.jsifaq.com
     
    Jerold Schulman, Mar 4, 2006
    #3
  4. guzzi

    guzzi Guest

    Thank you :)

    i'll try it
     
    guzzi, Mar 7, 2006
    #4
  5. guzzi

    guzzi Guest

    and what about to list a default e-mail adress?

    TIA
     
    guzzi, Mar 10, 2006
    #5
    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.