Exchange 2007 custom address list attributes
Exchange 2k7 on win 2k3. I need to create an address list and include contacts based on there email address. For example I need an address list for only those with email addresses ending in @chicago.mydomain.com, another list with only those contacts that have email addresses ending in @washington.mydomain.com. Currently I have a GAL with almost 170,000 contacts in it. I think I need to use a custom attribute, I tried defining the custom attribute as SMTP: %@washington.mydomain.com and that returned nothing. Any ideas?
June 17th, 2010 3:21am

Anyone have any guidance on this? I've been googling all morning and all I can find is how to do it based on OU membership.
Free Windows Admin Tool Kit Click here and download it now
June 17th, 2010 7:07pm

Set this value "washington.mydomain.com" as the custom attribute1 on all the desired contacts like this get-mailcontact ResultSize Unlimited | where {$_.ExternalEmailAdrress -like '@chicago.mydomain.com'}|Foreach{Set-mailContact $_.Identity -CustomAttribute1 chicago.mydomain.com} Now create the AL using the CustomAttribute1 of mail contacts like this new-addresslist -name myContacts -includedRecipients mailContacts -ConditionalCustomAttribute1 chicago.mydomain.com Hope this help u. Regards, Laeeq Qazi|Team Lead(Exchange + Sharepoint + BES + DynamicsCRM) www.HostingController.com
June 17th, 2010 7:37pm

Thanks for the response, I get an error: Get-MailContact : A parameter connont be found that matches parameter 'Unlimited'
Free Windows Admin Tool Kit Click here and download it now
June 17th, 2010 8:46pm

I got it to run by adding a - before ResultSize. It ran and I created the Address list successfully but it yields no results. Any ideas?
June 17th, 2010 9:35pm

Hi, Sorry dear my mistake. I commited 3 mistakes, 1st one u already diagnosed missing the - before ResultSize, and second one missing the * in the filter where {$_.ExternalEmailAdrress -like '*@chicago.mydomain.com'} and 3rd one wrong spelling of Address. So now first set the CA1 again and then preview the address list in EMC. get-mailcontact -ResultSize Unlimited | where {$_.ExternalEmailAddress -like '*@chicago.mydomain.com'}|Foreach{Set-mailContact $_.Identity -CustomAttribute1 chicago.mydomain.com} Your address list is dependant upon CutstomAttribute1 of each mail contact. So first verify that CustomAttirbute1 has been set for each of the contact get-mailcontact -ResultSize Unlimited | where {$_.ExternalEmailAddress -like '*@chicago.mydomain.com'}|FL ExternalEmailAddress,CustomAttribute1 see if CustomAttribute1 has been set. Regards, Laeeq Qazi|Team Lead(Exchange + Sharepoint + BES + DynamicsCRM) www.HostingController.com
Free Windows Admin Tool Kit Click here and download it now
June 18th, 2010 10:15am

OUTSTANDING!!!! That worked. One more questions, if I later add more contacts for the chicago.mydomain.com domain I will need to run the script again correct, not recreate the address list but just rerun the script?
June 18th, 2010 8:12pm

OUTSTANDING!!!! That worked. One more questions, if I later add more contacts for the chicago.mydomain.com domain I will need to run the script again correct, not recreate the address list but just rerun the script? Yes, You will have to set CustomAttribute1 for all new contacts of this domain to make them part of your custom address list. If you create your contact using EMC then you will have to set CustomAttribute1 either via EMC or via powershell. If you want to create contacts using EMS then you have an option of using Templates where you can use one of your existing contact as a template for new contact, where new contact will have replica of properties of existing contact including CustomAttributes, in that case you will not have to set CustomAttribute1 separately. Plz have a look into this http://technet.microsoft.com/en-us/library/bb125152(EXCHG.80).aspx Regards,Laeeq Qazi|Team Lead(Exchange + Sharepoint + BES + DynamicsCRM) www.HostingController.com
Free Windows Admin Tool Kit Click here and download it now
June 19th, 2010 11:52pm

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

Other recent topics Other recent topics