how to edit Global Address List Recipient filter

Posted on 2013-05-22
Last Modified: 2013-05-22
Can someone assist me with my powershell syntax...

When we create new GAL's for each client on our Exchange 2010 system  we run the following powershell script...
New-GlobalAddressList -Name "ClientX - GAL" -ConditionalCustomAttribute1 "ClientX" -IncludedRecipients MailboxUsers,MailGroups -RecipientContainer "domain.local/clients/ClientX"

We use this as we find clients like to see all users and distribution groups in the same place when they look at the address book in Outlook.  They moan when they have to navigate through to the folders in the tree on the left... *sigh* users will be users.
They have now asked us to add some Mail Contacts to the same place
So my question is this.. how to I edit the GAL to add the filter to include mailcontacts too?

I'm guessing I need to start with get-GlobalAddressList "ClientX - Gal".
I'm just unsure of the command to add the mailcontacts recipient filter.

Question by:ChallowSupport
  • 2
  • 2
LVL 12

Expert Comment

ID: 39187057
Please try the following command. Only modification made is the addition of 'MailContacts' in IncludedRecipients. Please verify the contacts are having CustomAttribute1 set as ClientX and they exist in the path domain.local/clients/ClientX

New-GlobalAddressList -Name "ClientX - GAL" -ConditionalCustomAttribute1 "ClientX" -IncludedRecipients MailboxUsers,MailGroups,MailContacts -RecipientContainer "domain.local/clients/ClientX"

Open in new window


Author Comment

ID: 39187128
Hi SreRaj

yes I can confirm that the contacts have the customattribute1 set as ClientX.  However your command does not work.  I suspect because the GAL already exists (see error below).  I would have thought I need a command something like get-GlobalAddressList "ClientX - Gal" | add-recipientfilter etc?

[PS] C:\Windows\system32>New-GlobalAddressList -Name "ClientX - GAL" -ConditionalCustomAttribute1 "ClientX" -IncludedRecipients
MailboxUsers,MailGroups,MailContacts -RecipientContainer "Domain.local/clients/ClientX"
Active Directory operation failed on DOMAINDC01.DOMAIN.LOCAL. The object 'CN=ClientX - GAL,CN=All Global Address Lists,CN=A
ddress Lists Container,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=DOMAIN,DC=LOCAL' alr
eady exists.
    + CategoryInfo          : NotSpecified: (0:Int32) [New-GlobalAddressList], ADObjectAlreadyExistsException
    + FullyQualifiedErrorId : 10EB12F8,Microsoft.Exchange.Management.SystemConfigurationTasks.NewGlobalAddressList

LVL 12

Accepted Solution

SreRaj earned 500 total points
ID: 39187288
Since we are modifying existing GAL, we should be using Set-GlobalAddressList. Please find the command as follows.

Set-GlobalAddressList -Name "ClientX - GAL" -ConditionalCustomAttribute1 "ClientX" -IncludedRecipients MailboxUsers,MailGroups,MailContacts -RecipientContainer "domain.local/clients/ClientX"

Open in new window


Author Comment

ID: 39187512
Perfect you are a star!... although you don't need -name

Set-GlobalAddressList "ClientX - GAL" -ConditionalCustomAttribute1 "ClientX" -IncludedRecipients MailboxUsers,MailGroups,MailContacts -RecipientContainer "domain.local/clients/ClientX"

Many thanks!

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lotus Notes – formerly IBM Notes – is an email client application, while IBM Domino (earlier Lotus Domino) is an email server. The client possesses a set of features that are even more advanced as compared to that of Outlook. Likewise, IBM Domino is…
A list of top three free exchange EDB viewers that helps the user to extract a mailbox from an unmounted .edb file and get a clear preview of all emails & other items with just a single click on mailboxes.
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to:…

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question