Skip to content

Update Country Code Attribute for Active Directory Users

In this guide, I’ll show you how to update the Country Code attribute in Active Directory using the AD Pro Toolkit.

When you change the Country/region settings for a user account in Active Directory it will actually update three attributes.

  • c
  • co
  • countryCode

country code single user

You can view these attributes with the Attribute Editor.

view country codes

To bulk update the countryCode requires setting these three attributes for each user.

Step 1. Get the country code

Get the c and countryCode values from the ISO country code page. You must use these ISO 3166 country codes or the update could fail.

Searching the website for the United States I find “US” for the c attribute and “840” for the countryCode. The co attribute can be anything so I’ll use “United States”.

get iso country code

If any of these 3 attributes are missing the update will fail, this is also true if using PowerShell.

Step 2. Setup CSV file

Download the provided CSV template from the user bulk updater tool. These attributes are already included in the template, you will need to add the users and values to be updated.

country code excel file

Above, is a screenshot of my CSV template, column A is the user accounts I want to update followed by the c, co, and countryCode attributes. Save your CSV file and move to step 3.

Step 3: Run Updater Tool

The last step is to run the Bulk Updater Tool. Select your CSV file and click the run button.

run country code update

All done. That is how you bulk update the Country value in Active Directory.

To verify the country code attributes have updated run the all users report and include the c, co, and countrycode columns.

check country codes