Dynamic Distribution Group Exchange 2016 based on OU

mrtro-1199 236 Reputation points

Dear experts
I am trying to create a a dynamic distribution group in our on-prem Exchange 2016. I want all users in a perticular OU but what I get is users in that OU and other OU:s aswell. It does seem to ignore the RecipientContainer option. See below for PS output:

Get-DynamicDistributionGroup -Identity justemployees | fl

RunspaceId : a0067603-55f1-673c-2341-18cfabdddddc
RecipientContainer : our.domain/OurOrg/Users/JustEmployees
RecipientFilter : ((RecipientType -eq 'UserMailbox') -and (-not(Name -like 'SystemMailbox{')) -
and (-not(Name -like 'CAS_{
')) -and (-not(RecipientTypeDetailsValue -eq 'Mail
boxPlan')) -and (-not(RecipientTypeDetailsValue -eq 'DiscoveryMailbox')) -and
(-not(RecipientTypeDetailsValue -eq 'PublicFolderMailbox')) -and (-not(Recipie
ntTypeDetailsValue -eq 'ArbitrationMailbox')) -and (-not(RecipientTypeDetailsV
alue -eq 'AuditLogMailbox')) -and (-not(RecipientTypeDetailsValue -eq 'AuxAudi
tLogMailbox')) -and (-not(RecipientTypeDetailsValue -eq 'SupervisoryReviewPoli
LdapRecipientFilter : (&(!(!(objectClass=user)))(objectCategory=person)(mailNickname=)(msExchHomeSe
IncludedRecipients : MailboxUsers

I created it in the GUI where I specified the OU in the membership section which was pretty straight forward but as said, it is not limiting to that OU.

What am I doing wrong?

Thanks for any help and comments.

Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
6,995 questions
0 comments No comments
{count} votes

Accepted answer
  1. Andy David - MVP 133.4K Reputation points MVP

    Yes, Check to see what s returned for:


    $<VariableName> = Get-DynamicDistributionGroup -Identity <DynamicDistributionGroupIdentity>  
    Get-Recipient -RecipientPreviewFilter ($<VariableName>.RecipientFilter) [-OrganizationalUnit ($<VariableName>.RecipientContainer)]  
    $FTE = Get-DynamicDistributionGroup -Identity "Full Time Employees"  
    Get-Recipient -RecipientPreviewFilter ($FTE.RecipientFilter)

1 additional answer

Sort by: Most helpful
  1. mrtro-1199 236 Reputation points

    Found this https://msexchangeguru.com/2017/11/17/ddg-issue/
    So does that mean that it is indeed working, it is just a matter i displaying the result in Powershell?

    0 comments No comments