countryCode Attribute

  • Last Post 22 July 2014
adwulf posted this 18 July 2014

Dear all,

I am looking at the countryCode attribute on various user accounts,
and trying to work out:
i) Which applications make use of it
ii) Which numbers mean which countries.

The MSDN documnetation for the attribute:

- seems to suggest that this is an ITU country code, and the only ITU
country code which is an integer would be one defined in E.164

But that doesn't really uniquely identify a country, especially not
for the documented purpose of specifying "the country/region code for
the user's language of choice". For example - a countryCode value of
"1" could be USA, or Canada, Grenada, Dominican Republic or American
Samoa - or many more.

I'm seeing countryCode values which appear to match those in ISO 3166-1 numeric:

Eg: Canada = 124, USA = 840.

Which standard is "expected", and by which software?

Is the reference to ITU just supposed to mean that the attribute has
been defined by the ITU in an old spec of DAP (without the L)?


Nie mój cyrk, nie moje małpy.
Not my circus, not my monkeys.


Order By: Standard | Newest | Votes
kool posted this 18 July 2014

IIRC, it is based on ISO 3166. I don't know which applications might use or set it. The countryCode on my UW user account is zero and I am using Exchange, Dynamics AX, Lync and other MS services. I did notice a handful of accounts that have countryCode set to 840 but I don't know what app set that value.

Eric Kool-Brown, University of Washington - IT Identity and Access Management


robertsingers posted this 19 July 2014

I always figured it was a vestigial part of x.500 that no one seems to have found a use for.


bdesmond posted this 20 July 2014

ADUC will set it if you pick someone's country in the UI I believe.

Brian Desmond

w – 312.625.1438 | c – 312.731.3132


adwulf posted this 21 July 2014

On 20 July 2014 22:57, Brian Desmond wrote:


kool posted this 21 July 2014

The ADUC address tab country drop-down is populated from the ISO 3166 list. I wrote this code back in 1999 and haven't looked at it since 2003, so my recollection is somewhat hazy but I recall opening a bug to develop a method to dynamically or periodically refresh this list. I don't think that bug was ever addressed (pun), so this list is probably frozen at values that are over a decade old.

At any rate, a selection from the drop-down sets 3 attributes: "c", "co", and "countryCode". All are ISO-3166 values.



sa.anupam posted this 22 July 2014

If you choose Country/Region, it does set that attribute by itself.


adwulf posted this 22 July 2014

Thanks, Eric - Out of curiosity, I just checked from a Windows 8.1
client machine, and ADUC does contain South Sudan in the list.

Looking a little further, it seems that the list is contained in the
file adprop.dll, which was updated for Windows 7 / 2008 R2 to include
South Sudan:

And updated to split Serbia/Montenegro before that: and

So, it looks like the bug has been addressed. Sort of.


kool posted this 22 July 2014

Thanks for checking Adam, good to know.