Active Directory: Name to NTID

Hello Folks,
I have a list of users first name last name ( john doe ) there any command that will retrieve me their ntid?

thanks for looking
ivan rosaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SeanSystem EngineerCommented:
Are you wanting to import the csv and get the user's ID back? Powershell will get you the information you want just need to know what you are trying to accomplish and how your csv is formatted exactly.

assuming you only have first name and last name it would be something like this.

$filepath = "c:\scripts\users.csv"
$users = Import-CSV $filepath -Header firstname,lastname

Foreach ($user in $users) {
Get-ADUser -Filter {givenname -eq "$_.firstname" -and surname -eq "$_.lastname"} -properties *| fl name,UserPrincipalName


Easily can be adjusted to any properties you are looking to get.
ivan rosaAuthor Commented:
thanks for the quick response, although when i run the script, it only jumped into another line of prompt, didn't give me any error nor result...

i did however found what i am looking for here:
dsquery user -name "john doe"|dsget user -samid -email -display -dept -title

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ivan rosaAuthor Commented:
this link will satisfy my question
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.