Active Directory
A set of directory-based technologies included in Windows Server.
6,244 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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
}