|One step further - PowerShell script to modify multiple users' property in Active Directory|
By: Ying Li
Posted On: 9/14/2007
In my previous script, I showed how we can add or modify the user properties in Active Directory for single user. Now as a by request script, I will go one step further and try to do the same thing for multiple users. The trick is you need to have a csv file ready and the import-csv cmdlet.
This article was Previously posted on Ying Li's Blog
I have a sample users.csv file and it looks like this:
Once you have the csv file ready – you could run the below script against it (You need to have the approriate right to your domain!)
$users = import-csv users.csv
foreach($row in $users)
$dn = $row.dn
$tel = $row.telephonenumber
You could change the Telephonenumber to EmployeeID or whatever fields you are interested at and it can target as many users as you want. Of course, test it in a small scale first!