Dynamic Distribution Group filter by CustomAttribute

Copper Contributor



I am trying to create a Dynamic Distribution Group filter like follows. Example recipients:

user1 CustomAttribute1: 'a','b'

user2 CustomAttribute1: 'b','a','c'

user3 CustomAttribute1: 'aa','b'


How can I get User1 and User2 to be included in the Dynamic Distribution Group DDG-Test because their CustomAttribute1 contains value 'a'?


I tried the RecipientFilter like this and learned this is not possible with the cloud DDG

       -RecipientFilter {CustomAttribute1 -like "*'a'*"}

       -RecipientFilter {CustomAttribute1 -match"'a'"}


What are other options to create Dynamic Distribution Group for criteria like this?


3 Replies
This seems to work here:

[09:50:24][O365]# Get-Mailbox shared | fl CustomAttribute5
CustomAttribute5 : 'a'

[09:51:18][O365]# Get-Recipient -RecipientPreviewFilter {CustomAttribute5 -like "*'a'*"}
Name RecipientType
---- -------------
shared UserMailbox
Hi Vasil,
Thank you for your reply!
I was wondering how can I apply this to the Dynamic distribution group member filtering?
Set-DynamicDistributionGroup -Identity "DDG-Test" -RecipientFilter ??
Oh right, forgot you cannot have a leading wildcard for DDG filter. So it doesn't look like it's possible, sorry.