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)
}

By amit_g

Welcome to my IT Infra Blog! My name is Amit Kumar, and I am an IT infrastructure expert with over 11 years of experience in the field. Throughout my career, I have worked with a wide variety of systems and technologies, from network infrastructure and cloud computing to hardware and software development. On this blog, I aim to share my knowledge, insights, and opinions on all things related to IT infrastructure. From industry trends and best practices to tips and tricks for managing complex systems, my goal is to provide valuable information that will help IT professionals and enthusiasts alike. Whether you are a seasoned IT veteran or just getting started in the field, I hope you will find my blog to be a valuable resource. In addition to sharing my own thoughts and ideas, I also welcome feedback, comments, and questions from my readers. I believe that a collaborative approach is the best way to advance the field of IT infrastructure and I look forward to hearing from you. Thank you for visiting my blog, and I hope you will continue to follow along as I explore the fascinating world of IT infrastructure. Sincerely, Amit Kumar

One thought on “Updating Bulk User Properties with Powershell”

Leave a Reply

Your email address will not be published. Required fields are marked *