Address List - filter based on country
I have a GAL with around 20K entries and i want to send mails only to people in specific country .. i guess the best way to create an Address list and filter the same via some attribute called country but i am not able to define this or same is not working for me .. can some one please guide how can i create an address list which will filter addresses from GAL based o
November 18th, 2013 7:48am

I believe you would use -RecipientFilter {c -eq 'US'}

http://technet.microsoft.com/en-us/library/bb738157(v=exchg.150).aspx

Free Windows Admin Tool Kit Click here and download it now
November 18th, 2013 3:22pm

thnaks ED for the reply ... but it didint worked for me.. ok let me tell you the scenario ..the GAL which i was talking to you i checked the entries from AD and i didnt found country entry reflecting there so my first issue now is to use set command and put the "CountryOrRegion" entry in the GAL contacts... so just to check i have one test setup and on that i executed below commands...

Import-Csv .\Contactstest.csv|%{New-MailContact -DisplayName $_.Name -ExternalEmailAddress $_.EmailAddress -Name $_.Name -FirstName $_.FirstName -LastName $_.LastName -OrganizationalUnit goevocloud.com/External-Contacts}  ===WORKED FINE - contacts creatd

$Contacts = Import-CSV .\contactstest.csv

$Contacts | ForEach {Set-Contact  $_.Name -StreetAddress ($_.Street  + " ") -StateorProvince ($_.State + " ") -PostalCode ($_.PostalCode + " ") -Phone ($_.Phone + " ") -MobilePhone ($_.MobilePhone + " ") -HomePhone ($_.HomePhone + " ") -Company ($_.Company  + " ") -OtherTelephone ($_.OtherTelephone + " ") -Fax ($_.Fax + " ") -CountryOrRegion ($_.Country + " ")} ==> this command is giving error, please see below screen shot. please advise... i guess now the first worry is to enter the country value in GAL contacts and then create access list based on filter.

November 19th, 2013 12:31am

In the future, please paste the text of the error instead of a screenshot.

You've stuck spaces on the end of every parameter value.  Why?  The country code, which is an especially picky parameter.  I believe that it should be the two-character country code as described here:  http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2   What happens if you put in "LU" (without trailing space) instead of "Luxembourg "?

You can also store the country in the format you have it in, say Custom (Extension) Attribute 1 and then build your lists based on that.

Free Windows Admin Tool Kit Click here and download it now
November 19th, 2013 1:55am

Hi,

Firstly, Id like to say, it's not recommended to modify GAL .

For a workaround, how about creating a new dynamic distribution group containing users in one country?
And you can create it by the following cmdlet:
New-DynamicDistributionGroup -Name "Mailbox Users in country -RecipientFilter {((RecipientTypeDetails -eq 'UserMailbox' -and countryname -eq 'country'))}

Then all users, whose properties are matched the filter, could become a group member.
http://technet.microsoft.com/en-us/library/bb123722(v=exchg.150).aspx

If sending emails to the dynamic distribution group, all users in the dynamic distribution group would receive.


If you have any question, please feel free to let me know.
Thanks,
Angela

November 19th, 2013 4:16am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics