I believe you would use -RecipientFilter {c -eq 'US'}
http://technet.microsoft.com/en-us/library/bb738157(v=exchg.150).aspx
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.
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.
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