Link to home
Start Free TrialLog in
Avatar of amku03
amku03

asked on

DSQUERY- Need to pull email IDS from AD

Hi,

I have a csv file with user first name, last name and logon name.
ineed to pull their email ids and update the file.
please suggest ....how to do this with dsquery dsget?
Avatar of Joseph Daly
Joseph Daly
Flag of United States of America image

In the csv file copy the user logon name column to a new text file. Save it as whatever you like. Then run the following bat below.
for /F "tokens=1" %%h IN (filename.txt) Do dsquery user -samid "%%h" |dsget user -ln -fn -email -samid
pause

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Joseph Daly
Joseph Daly
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Please check link, might help you.

http://www.manageengine.com/products/ad-manager/
Avatar of amku03
amku03

ASKER

Thanks for your time!!