Forum Discussion

Pn1995's avatar
Pn1995
Brass Contributor
May 16, 2019

How to exclude a user from a Dynamic Distribution List

HI

 

We have a dynamic distribution list setup on Office365 that includes everyone with exchange mailboxes...

 

We want to EXCLUDE a couple of people from this list. Anyone know how to do this?

 

Thanks

 

  • You simply need to adjust the recipient filter for the group. For example, if you want to exclude a single user by name:

     

    ((UsageLocation -eq 'Bulgaria') -and (Name -ne 'vasil'))

     

    You can use any other attribute accordingly. Or target groups of users based on common criteria.

     

     

    • Pn1995's avatar
      Pn1995
      Brass Contributor

      Thanks VasilMichev

       

      Sorry for the simple question, but how would I exclude a user called "test" were would i put that filter?

       

      Is it done in powershell ? if so what is the actually command?

      • Yes, in PowerShell, via the Set-DynamicDistributionGroup cmdlet. Get the filter first:

         

        Get-DynamicDistributionGroup | fl Name,RecipientFilter

         

        Then append the additional inclusion/exclusion criteria as needed. You can ignore anything after the "-and (-not(Name -like 'SystemMailbox{*'))" part, this will be added automatically.

    • Pn1995's avatar
      Pn1995
      Brass Contributor

      ChrisHoardMVP thanks, we aren't using any attributes though to add users.

       

      How do we exclude a user? Can we not do it by there email address?

       

      There doesn't seam a option in the GUI - do we need to run some kind of powershell?

       

      If so anyone got a example

       

      Thanks

Resources