active-directoryldap

What are the values for the 'country' field in Active Directory?


I have a feeling Windows expects 'country' to be an integer, with 0 meaning 'US'. If that's the case, what's the mapping between integers and ISO 2-letter country codes?active


Solution

  • See this link here:

    ISO 3166 Country Codes

    Seems to be standard ISO 3166 country codes used in several places.

    Same result from this post here: Active Directory and .NET

    Point 5 reads:

    5. Set user's country

    To set the country property for a user was one of the tasks that took me some time to figure out. After some hours of research I realized that you need to know the ISO 3166 Codes for countries and set three properties to define a user's country: c, co, and countryCode.

    Best overview that includes the elusive ISO 3166 numeric codes can be found on Wikipedia - of course! (at ISO itself, you can't seem to get those lists for free - you have to pay for the privilege....)