Membership on Dynamic Distribution Group

Copper Contributor

I have some address mail like this "name.ext@mydomain". I would like to create a DDG with all these users. But if I try to use this command:


Set-DynamicDistributionGroup -Identity "myDDG" -RecipientFilter "(windowsliveid -like '*.ext@mydomain')"

it fails because the * it's not valid as first character. 

How can I filter all the ext users and add them to my DDG? 

2 Replies
You cannot use leading wildcards. try the -match operator instead. If the idea is to include only Guest users, you can filter them based on the object type (RecipientTypeDetails -eq 'GuestMailUser')

@Vasil Michev 



if I use -match this is the error:

Cannot process argument transformation on parameter 'RecipientFilter'. Cannot convert value "(windowsliveid -match '.email address removed for privacy reasons')" to type 
"System.String". Error: ""-match" is not a valid operator. For a list of supported operators see the command help.

I use "ext" only as example, they are not guests users.