ivan rosa
asked on
Active Directory: Name to NTID
Hello Folks,
I have a list of users first name last name ( john doe )...is there any command that will retrieve me their ntid?
thanks for looking
I have a list of users first name last name ( john doe )...is there any command that will retrieve me their ntid?
thanks for looking
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
this link will satisfy my question
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.