none
Recipient Filter not working for a Dynamic Distribution Group not working. RRS feed

  • Question

  • Hello,

    I was successfully able to create a new DDL.

    Then ran: Set-DynamicDistributionGroup -Identity Test1234 -RecipientFilter {((RecipientType -eq 'UserMailbox') -and -not(Alias -like 'pro.tech'))}

    RecipientFilter                        : ((((RecipientType -eq 'UserMailbox') -and (-not(Alias -like
                                             'pro.tech')))) -and (-not(Name -like 'SystemMailbox{*')) -and (-not(Name
                                             -like 'CAS_{*')) -and (-not(RecipientTypeDetailsValue -eq 'MailboxPlan'))
                                             -and (-not(RecipientTypeDetailsValue -eq 'DiscoveryMailbox')) -and
                                             (-not(RecipientTypeDetailsValue -eq 'PublicFolderMailbox')) -and
                                             (-not(RecipientTypeDetailsValue -eq 'ArbitrationMailbox')) -and
                                             (-not(RecipientTypeDetailsValue -eq 'AuditLogMailbox')) -and
                                             (-not(RecipientTypeDetailsValue -eq 'AuxAuditLogMailbox')) -and
                                             (-not(RecipientTypeDetailsValue -eq 'SupervisoryReviewPolicyMailbox')))

    Has you can see, everything is pretty much uniform, and standard. In the part (-not(Alias -like 'pro.tech')))). I tried replacing Alias with other Mailbox Properties, as stated in article https://docs.microsoft.com/en-us/powershell/exchange/exchange-server/recipient-filters/recipientfilter-properties?view=exchange-ps

    Can anyone see anything, or help add modify what I have to get this work? Basically, we want all User Mailboxes in the DDL, but excluded one mailbox.


    Ryan

    Wednesday, August 8, 2018 12:23 AM

Answers

  • Update,

    Got this issue resolved by using:

    Get-Mailbox | ? {$_.RecipientType -eq 'UserMailbox'} | Set-Mailbox -CustomAttribute1 "Member of DDL"

     

    Set-DynamicDistributionGroup -Identity Test1234 -RecipientFilter {((CustomAttribute1 -like 'Member of DDL') -and -not(EmailAddresses -eq 'ryan.bennett*'))}

    Oddly, using Recipient Type for the filter didn't want to exclude one user from the DDL. So I simply tiptoe around this by just using different Attributes for the filter. Finally confirmed using:

    $FTE = Get-DynamicDistributionGroup "Full Time Employees"

    Get-Recipient -RecipientPreviewFilter $FTE.RecipientFilter -OrganizationalUnit $FTE.RecipientContainer


    Ryan

    • Marked as answer by Cypher Net Wednesday, August 8, 2018 4:29 PM
    Wednesday, August 8, 2018 4:29 PM

All replies

  • So what exactly is not working? If not all mailboxes are being included, did you make sure that you are creating the DDG in the correct OU, or adjust the RecipientContainer parameter accordingly. Check the cmdlet help for more info: https://docs.microsoft.com/en-us/powershell/module/exchange/users-and-groups/new-dynamicdistributiongroup?view=exchange-ps
    Wednesday, August 8, 2018 8:32 AM
  • Hello Vasil L. Michev,

    What not working, is that the user "pro tech" is getting emails, when it shouldn't. The RecipientContainer not going to work, since the mailboxes are hosted in Exchange Online (unless you know something I don't).

    I've tried filtering without using RecipientType, and set other Attributes to separate users, still nothing.

    (This didn't work either) Set-DynamicDistributionGroup -Identity Test1234 -RecipientFilter {((CustomAttribute1 -like 'Member of DDL') -and -not(EmailAddresses -eq 'ryan.bennett*'))}

    Thanks,


    Ryan



    • Edited by Cypher Net Wednesday, August 8, 2018 2:57 PM
    Wednesday, August 8, 2018 2:28 PM
  • Update,

    Got this issue resolved by using:

    Get-Mailbox | ? {$_.RecipientType -eq 'UserMailbox'} | Set-Mailbox -CustomAttribute1 "Member of DDL"

     

    Set-DynamicDistributionGroup -Identity Test1234 -RecipientFilter {((CustomAttribute1 -like 'Member of DDL') -and -not(EmailAddresses -eq 'ryan.bennett*'))}

    Oddly, using Recipient Type for the filter didn't want to exclude one user from the DDL. So I simply tiptoe around this by just using different Attributes for the filter. Finally confirmed using:

    $FTE = Get-DynamicDistributionGroup "Full Time Employees"

    Get-Recipient -RecipientPreviewFilter $FTE.RecipientFilter -OrganizationalUnit $FTE.RecipientContainer


    Ryan

    • Marked as answer by Cypher Net Wednesday, August 8, 2018 4:29 PM
    Wednesday, August 8, 2018 4:29 PM