Share via

Exch.> dynamic distr. mailer - Filter "recipient container" not working

Stefan K 106 Reputation points
2026-03-23T12:16:29.72+00:00

We use Exchange Server SE on-prem.

I created a dynamic distribution mailbox "all" and set the "recipient filter" to the AD OU where all users, and ONLY users, are located. Sorry it's german but is defines USERS WITH EXCHANGE-MAILBOXES and RECIPIENT CONTAINER
User's image

But when I test ist using this code block, I get many mailboxes from upper OUs as well.

      $ALLEGruppe = get-DynamicDistributionGroup -Identity ALLE
      Get-Recipient -RecipientPreviewFilter ($ALLEGruppe.RecipientFilter)
Exchange | Exchange Server | Management
Exchange | Exchange Server | Management

The administration and maintenance of Microsoft Exchange Server to ensure secure, reliable, and efficient email and collaboration services across an organization.

0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Hin-V 13,385 Reputation points Microsoft External Staff Moderator
    2026-03-23T13:33:17.81+00:00

    Hi @Stefan K

    This issue appears to be related to how the preview or validation cmdlet works.

    Based on my research, a Dynamic Distribution Group does not have a fixed list of members. Instead, every time an email is sent to the group, Exchange performs the following steps:

    Evaluate the RecipientContainer

    This defines the search scope (an OU or the entire domain) in Active Directory.

    Apply the RecipientFilter

    Exchange filters the objects within that scope to find recipients that meet the specified conditions.

    Deliver the email

    The message is sent to all recipients who satisfy both the RecipientContainer and the RecipientFilter.

    During actual email delivery, Exchange always correctly combines RecipientContainer and RecipientFilter.

    However, the cmdlet you are currently using only evaluates the RecipientFilter and does not automatically apply the RecipientContainer.

    As a result, PowerShell returns all mailboxes across the default scope (domain or forest) that match the filter, including mailboxes outside of the OU configured for the group. To preview the actual recipients who will receive the email, you need to explicitly specify the OU (RecipientContainer) when running the preview cmdlet.

    You can use the following commands:

    $group = Get-DynamicDistributionGroup -Identity "GROUP_NAME" 
    Get-Recipient ` 
    -RecipientPreviewFilter ($group.RecipientFilter) ` 
    -OrganizationalUnit ($group.RecipientContainer) 
    

    When the -OrganizationalUnit parameter is included, the returned results will accurately match the recipients who will truly receive emails sent to the Dynamic Distribution Group.

    User's image

    You can refer via: View members of a dynamic distribution group | Microsoft Learn 

    Please feel free to correct me if I misunderstood your request. If you have any additional concerns, feel free to comment below. I would be more than happy to assist. 


    Note: Please follow the steps in [our documentation] to enable e-mail notifications if you want to receive the related email notification for this thread. 

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.