No one has responded to this discussion for at least a year, so this information may be out of date. If you're looking for information about this topic, please search for a more recent discussion or post a new question.

How to add distributiongroup to a Dynamic Distributiongroup

This question is answered This question is answered

We have a mixed enviroment with both federated and onpremis-accounts.We use Distributiongroups connected to Mailcontacts to generate direct forwarding of mail to a mailadress in our domain to a external maildomain.


With Powershell I have managed to create a Dynamic distributiongroup that use the deparment-attributewith the help of this forum and Help-topics.

But now I would also add these distributiongroups to my dynamic distributiongroups.

Is this possible? Do distributiongroups have any attributes that I can set & use?

The Name & Displayname of the distributiongroups does not follow any standard so
it would be hard create a good filter on those.


Any ideas?

Verified Answer
  • Hi Anders,

    You can add the other addresses as proxy address on a distribution group. Then run the command you mentioned above.

    Monica Tong

All Replies
  • Hi Anders,

    I understand that you prefer to add distribution groups to a Dynamic Distribution group.

    To achieve your goal, you can refer the following article:

    You can run the following command:
    New-DynamicDistributionGroup -Name NewDDG  -RecipientFilter (alias -eq "dg-01")

    Monica Tong

  • Hi Anders,

    How are things going? Is the issue resolved?

    Monica Tong

  • Hello Monica

    Thank you for your reply.

    I have been out of the office therefore the late response.

    In your code you use the Alias-property to do a filter, but if I want a user to be member of several DynDG then I would have to change the Alias

    every time I create a new dynDG and add a value specific for the new dynDG or if I want to remove a user then I would have to find that value in his

    Alias and just remove that part. That dont seem to be "admin"-friendly. :( and the Alias would be quit long.

    Is there any way I can set multiple smtp-adresses on a distributiongroup and then use a recipientFilter to do a like-comparison to see if a part of the emailadress is present?


    Distributiongroup to add to a DynDG:

    Displayname: Adam King


    The I would like to create a DynDG for owners & vicepresident.

    New-DynamicDistributionGroup -Name NewDDG  -RecipientFilter (EmailAddresses -like "*DynOwner*" or EmailAddresses -like "*DynVicePresident*")

    Would this find the second & third emailadresses of Adam Kings Distributiongroup and send him the mail sent to NewDDG?

  • Hi Anders,

    You can add the other addresses as proxy address on a distribution group. Then run the command you mentioned above.

    Monica Tong

  • Hi Anders,

    Is the issue resolved? Do you need any further assistance with this question?

    Monica Tong

  • Thank you for your help. I will start coding and try your code as soon as time allows :)

  • Hello again

    I have now had time to do some testing and after a while I got it almost right.

    This code creates the DynDG

    New-DynamicDistributionGroup -Name "TestPS Owner DynDL"  -RecipientFilter {((EmailAddresses -like "DynOwner*") -or (EmailAddresses -like "DynVicePresident*"))}

    I also tried this code to exclude any typo with the -or parameter:

    New-DynamicDistributionGroup -Name "TestPS Owner DynDL"  -RecipientFilter {(EmailAddresses -like "DynOwner*")}

    But when I list the members of the DDG its empty :(

    $DDG = Get-DynamicDistributionGroup "TestPS Owner DynDL"

    Get-Recipient -RecipientPreviewFilter $DDG.RecipientFilter

    I have a user with this proxyadress added to him:

    Primary adress:


    Any ideas on how to get this to work?

  • Hello Anders,

    I have found some additional links that may assist you. If you experience any problems, I recommend consulting a Microsoft Partner, if you do not have one, already. The resources I found are: - "Create Dynamic Distribution Groups Using Precanned Filters" - "Create Dynamic Distribution Groups Using Customized Filters" - "Additional Parameters You Can Use with Dynamic Distribution Groups"

  • Thank you Ken.

    I have no problem with creating the Dynamic Distribution Distributiongroup, the problem I have now is how to get the customized filter to accept

    emailadresses as parameter and locate the proxyadress of the user.

    according to this article: (Filterable Properties for the -RecipientFilter Parameter in Exchange 2007 SP1 and SP2)

    I can use the attribute EmailAddresses in the recipient filter. (Or has that changed i Exchange 2010?)

    Property name: EmailAddresses

    LDAP display name: proxyAddresses

    Description: This property contains the e-mail addresses of this recipient. All Exchange 2007 e-mail address types are valid. Separate multiple values by using commas.

    Value: E-mail address, Wildcard character accepted

    I use this code to create the filter:


    New-DynamicDistributionGroup -Name "TestPS2 Owner DynDL"  -RecipientFilter {(EmailAddresses -like "")}

    --end code--

    I have a user that have these two mailadresses: (primary)

    But when sending a mail to TestPS2 Owner DynDL nothing is delivered to testnewuser16 so the recipeintfilter is not working as I expect it to do.

    Im thinking of open a new thread with this specifik question on recipientfilter since the initial question is answered, I can add a DG to a DynDG and use filters to include the DG.

    Should I set this thread as solved and open a new thread?

  • Hello Anders,

    Yes I would recommend doing just that. Customized filters are beyond my support boundary, but it may help to put the question out to the community in a new thread.