Address List and RecipientFilter for dynamic distribution lists

Hi guys

I am trying to setup a Address List in exchange that contains dynamic distribution lists specified by the list name. So address List abc should contain dynamic distribution lists with list names "def" and "ghi" and "jkl"

So far I have come up with below which displays all dynamic distribution lists. this works but how can I now filter further to specific lists?

New-AddressList -Name abc -RecipientFilter {((Alias -ne $null) -and (ObjectClass -eq 'msexchdynamicdistributionlist'))}

Example of what I am trying to acheive:

New-AddressList -Name abc -RecipientFilter {((Alias -ne $null) -and ((ObjectClass -eq 'msexchdynamicdistributionlist') -and ('msexchdynamicdistributionlist' -eq 'def') -or ('msexchdynamicdistributionlist' -eq 'ghi') -or ('msexchdynamicdistributionlist' -eq 'jkl'))}

February 24th, 2015 1:15pm

The filter for dynamic distribution lists is redundant if you think about it as you're then specifying by name the lists you want to include:

New-AddressList -Name abc -RecipientFilter {((Alias -ne $null) -and (('msexchdynamicdistributionlist' -eq 'def') -or ('msexchdynamicdistributionlist' -eq 'ghi') -or ('msexchdynamicdistributionlist' -eq 'jkl'))}
Free Windows Admin Tool Kit Click here and download it now
February 24th, 2015 5:50pm

thanks crm

Are you suggesting I could just use below:

New-AddressList -Name test -RecipientFilter {((Alias -ne $null) -and (name -eq 'def') -or (name -eq 'ghi') -or (name -eq 'jkl'))}

I checked here and "name" seems the only relevant filterable property for me to target group names however no groups are returned when I use above filter.

February 24th, 2015 7:34pm

Rather than use name, use the UserPrincipalName in the recipientfilter.  It is unique, and so more reliable.
Free Windows Admin Tool Kit Click here and download it now
February 25th, 2015 2:10am

Hi,

I have some tests in my environment using Exchange 2013. You can use the following cmdlet to create an address list that contains specified distribution group members.

New-AddressList -Name test3 -RecipientFilter {((Alias -ne $null) -and (MemberOfGroup -eq 'CN=Sales,CN=Users,DC=contoso,DC=com'))}

Note that it can't work for dynamic distribution group. In your case, I haven't found a parameter for dynamic distribution group in Exchange, your understanding will be appreciated.

Hope my clarification can be helpful to you.

Best regards,

February 26th, 2015 4:29am

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

Other recent topics Other recent topics