Hi,
I need to update the Existing all AD users firstname, last name and email address with a csv.. and i need the csv format for above task..
Hi,
I need to update the Existing all AD users firstname, last name and email address with a csv.. and i need the csv format for above task..
I figured out the script
$users = Import-Csv -Path c:\scripts\users.csv
foreach ($user in $users) {
Get-ADUser -Filter "SamAccountName -eq '$($user.samaccountname)'" -Properties * |
Set-ADUser -givenName $user.givenName -displayname $user.displayname -Surname $User.sn -Email $user.mail
}
Thank you for sharing your solution with the community .
8 people are following this question.