Page 1 of 1

DSQuery get names from user ID

Posted: 14 Jun 2012 08:48
by SMAndy
Hi all.

I've got a huge list of user ID's (as in login ID's) and i need to get their actual names. Going through AD searching for the user ID and getting their name is a very slow process, and i'm sure there's something like dsquery i can use to get it all.

I've never used dsquery really, though. So I have no idea how to even begin this.

For reference though, i'm going to have a big list of user ID's in a text file, one on each line.

Thanks for any help!

Re: DSQuery get names from user ID

Posted: 15 Jun 2012 07:14
by Squashman

Code: Select all

FOR /F "delims=" %%G in (Users.txt) do net user "%%G" /domain | find "Full Name"