Question: On Windows XP in an Active directory environment - what is the easiest way for me to query a user's email address from AD given their username on the command line. 

(Assuming I know where it is kept normally in tree). 

(I know about net user *loginname* /domain but I just want the email address element back.)

Answer: 
```
dsquery user -name "user name"|dsget user -samid -email -display 

```
dsquery user -name "Firstname Lastname" | dsget user -email