Update User Data

GitHub

mattiasvdlbe/Active Directory/UpdateUserData

Why?

I had to make a bulk update of data for a list of users, and instead of opening each user profile one by one and changing the values, I decided to write a script which could do this in bulk for me. It saved me a lot of time and avoided typing and other user errors.
I only needed to make sure the input csv was set up correctly.

What?

I started of with an export of all necessary fields from the Active directory, made this a bit more readable for the people responsible for determining the data which needs to be updated, and provided the file to them for correction of the data.
When I received the file back, I made sure all necessary data was filled in, generated the necessary codes for the countries, and generate the .csv file this script needs to make the updates.

This script loads in the .csv file and loops over all users in the file and updates the necessary fields.

More information

  • The titles in the .csv file are the names used in AD.
    You can look these up in the “Attribute Editor” tab.
  • For the Country details:
    • “c” = 2-character ISO-3166 country code (ex.: BE)
    • “co” = the name of the country as a text string (ex.: Belgium)
    • “countryCode” = the country code for the user’s language of choice (ex.: 56)

List of ISO 3166 country codes – Wikipedia

  • In this script I only changed a couple of fields, as more where not required in this case.
    I also just cleared some attributes, without replacing them.
    You should be able to edit the code based on this example in case you need to edit more attributes.