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
相关问题
- Active Directory on-prem Manager
- PrincipalContext LDAPS Self-Signed Certificate
- System.DirectoryServices vs system.directoryservic
- Get all attributes from Active Directory using Spr
- Filter ldapsearch with awk/bash
相关文章
- getting user details from AD is slow
- Can't get deleted items from OpenLDAP Server u
- Is it possible to send LDAP “requests” via telnet?
- GetNamedSecurityInfo returns ERROR_ACCESS_DENIED(5
- GWT JDBC LDAP connection fails
- Getting the user's Full Name from Active Direc
- Set Access to dropdownlist items based on the User
- dsmod or other command to edit AD user attributes
There are three different properties that must be set in Active Directory. Each is designated in the ISO 3166 standard. The ISO website has a search tool that you can use to find the official codes. Select Country codes and hit search, then click on Officially assigned... on the left.
c
— 2 digit abbreviation (e.g. US)co
— Country name (e.g. United States). Microsoft got really detailed on their description for this one.countryCode
— Numeric Id (e.g. 840)Note: If you want to clear the country field, then you need to set this value to
0
. You cannot set it tonull
orString.Empty
. It will throw aDirectoryServicesCOMException
stating "The server is unwilling to process the request" when you callCommitChanges()
if you try to set it to anything other than anint
.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:
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....)
There's two country properties,
countryCode
andc
, both are ISO 3166 values. The former is a number and the latter a string (ISO 3166 A2).See ISO 3166.
Also, there's the
co
property which is the name of country.