DSQuery get names from user ID

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
SMAndy
Posts: 8
Joined: 28 May 2012 03:23

DSQuery get names from user ID

#1 Post by SMAndy » 14 Jun 2012 08:48

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!

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: DSQuery get names from user ID

#2 Post by Squashman » 15 Jun 2012 07:14

Code: Select all

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

Post Reply