Forum Discussion

gnussbaum's avatar
gnussbaum
Copper Contributor
Dec 30, 2022

creating a dynamic distribution group with a RecipientFilter of 'Description'

I'm trying to create a dynamic distribution group of full-time employees. Their status is in the user's account description. I've tried the following to no avail:

 

New-DynamicDistributionGroup -Name "DDL-Test" -RecipientFilter "(RecipientType -eq 'UserMailbox') -and (Description -eq 'Employee')".  The Description is the field in on-prem AD under the 'General' tab.

 

I followed this link that says 'Description' is filterable recipient property:

 

https://learn.microsoft.com/en-us/powershell/exchange/recipientfilter-properties?view=exchange-ps

 

Any suggestions?

5 Replies

  • Rene_Gross's avatar
    Rene_Gross
    Iron Contributor

    gnussbaum hello, maybe this helps:

    - i have only exchange on-prem

     

    New-DynamicDistributionGroup -Name "DDL-Test" -Alias DDL-Test -OrganizationalUnit "yourAdDomain/yourOU/yourOUforSavingDistributingList" -RecipientFilter {((RecipientTypeDetails -eq 'UserMailbox') -and (Description -eq 'Employee'))} -RecipientContainer "yourAdDomain/yourOU/OUwithUsers"

     

    - you dont need Parameter "-RecipientContainer", if your scope is the entire AD

    - i didnt do this with the description field, but can test this in the next few days

    - if you have exchange online would say is the same, but not sure

     

    best wishes

    René

    • TonyRedmond's avatar
      TonyRedmond
      MVP
      Maybe you could use of the custom attributes instead and script the copying of the description field into the custom attribute?
      • gnussbaum's avatar
        gnussbaum
        Copper Contributor
        Thanks for replying Tony. I was thinking of that, but to be honest, I'm not sure how to do that.
    • gnussbaum's avatar
      gnussbaum
      Copper Contributor
      thanks René. I don't think you can do this with Exchange Online because the OU points to the one in the online portal, not on-prem.

Resources