Create Exchange Address Lists

For quick creation of exchange address lists, EAC or EMC can be used, when only a subset of AD attributes are needed for creating filter (AD container, State or Province, Company, Department, ExchangeAtribute1-15). If these attributes does not meet your needs for creating filter, Exchange Powershell is your friend. New-AddressList contains RecipientFilter parameter for creating advanced queries for filtering recipients. For more info about filterable properties that can be used in RecipientFilter parameter please check the following article : https://technet.microsoft.com/library/bb738157(EXCHG.80).aspx .

For example:
New-AddressList -Name TestList -RecipientFilter {((Alias -ne $null) -and (((Recipienttype -eq 'UserMailbox') -or (Recipienttype -eq 'MailUniversalDistributionGroup') -or (Recipienttype -eq 'MailUniversalSecurityGroup') -or (Recipienttype -eq 'PublicFolder')) -or ((Recipienttype -eq 'MailContact') -and (ExternalEmailAddress -like '*domain.com'))))}
In this example, TestList address list is created with following requirements: Alias is set and recipient types are UserMailbox, UniversalDistributionGruoup, UniversalSecurityGroup, Publicfolder and only Mailcontacts that have domain.com in their External Email Address.
 

Comments

Popular posts from this blog

How to convert string to Base64 and vice versa using Powershell

Machine domain group policy failed to apply

Failover Clustering Event 1196 and 1228