We help IT Professionals succeed at work.

Country/Region is not visible in Global Address List but does appear in ADUC

Hi all.  I use the following code successfully to create users in the Users container along with a mailbox.  The country is populated by querying sql, then doing an IF statement, then setting the attribute.

My problem is that when I use this vbscript code to create a contact, the Country/Region field is blank.  I can go back into the GUI of ADUC and change to a different country and then apply....then change back to the original country and it then shows up in the GAL.

This issue also happens when creating users.  This happens in the Users container as well as the Contacts OU.

Any ideas?  I am running Exchange 2003.
strCountry is the value pulled from my SQL query.

                      vCountry = "USA"
      vCountryCa = "Canada"
      if  strCountry = vCountry then sCountry = "US"
      if  strCountry = vCountryCa then sCountry = "CA"
if sCountry <> "" then
      oContact.put"c", sCountry
      end if


The country/region shows up in ADUC.

Comment
Watch Question

Justin OwensITIL Problem Manager

Commented:
If you use ADSI Edit to compare the two contacts in AD, one which does not show up correctly and one which does, do you see any null fields in the one which does not show up correctly which are populated in the ones that do?
Justin

Commented:
Do you have a "oContact.SetInfo" line anywhere? Maybe try adding it to your IF block, as per the following

if sCountry <> "" then
      oContact.put"c", sCountry
      oContact.SetInfo
      end if


The fix was to set both the "c" attribute and the "co" attribute in Active Directory when creating the user or contact.