Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DSQUERY

Status
Not open for further replies.

jarnold

ISP
Nov 23, 2001
11
CA
I am using Exchange 2003 running on Windows 2003 Server.

I use DSQUERY to export information to a text file and send it to the person who requesting the information. Does anyone know if there is a command for DSQUERY USER to only pick up users with e-mail addresses? I can view the information using Find in Active Directory, but I cannot see the syntax being used.
 
dsquery user | dsget user -samid -email | findstr /i /c:"@youremaildomain.here"

This is just an example. The -samid can be replaced with any number of options (i.e. -fn -ln or -dn or -display ect) depends how you want your output.

The findstr looks at all the output and only returns lines with the @youremaildomain.here string (case insensitive -i)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top