We can bulk update the AD user attributes with the values from a CSV file. For example, we have a CSV file with the list of windows accounts with samAccountName, Email address in the below format. Similarly, you can select other attributes for users which you want to update
To update user attributes using the values from the CSV file, run the following PowerShell command:
Import-Module ActiveDirectory
$Attribcsv=Import-csv “c:\ad_data\users_description.csv”
ForEach ($User in $Attribcsv)
{
Get-ADUser -Identity $User.samAccountName | set-ADUser -EmailAddress $($User.mail)
}
Hi,
I want to update the office filed. can you share the script for that.