Share via

Dynamic distribution list

Anonymous
2022-11-14T13:19:05+00:00

Hi,

I created a dynamic dist list in Exchange and chose Attribute - Department and it worked as it should

But i want a new list where it takes City but cant find that attribute. only ones i can pick are State Provinse Department and then Custom attributes 1-15

but in my local AD, we have City in I = Stockholm

in Exchange

Microsoft 365 and Office | Subscription, account, billing | For business | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2022-11-14T19:45:10+00:00

    Hello EA1979,

    Good day!

    Thank you for posting to Microsoft Community. We are glad to assist.

    Based on your description, you can create the new dynamic distribution list using the New-DynamicDistributionGroup cmdlet in Exchange Online PowerShell. You need to be assigned permissions before you can run this cmdlet.

    Under the parameters you can use the RecipientFilter parameter to specify a custom OPATH filter that's based on the value of any available recipient property. You can use any available Windows PowerShell operator, and wildcards and partial matches are supported. This search criteria uses the syntax "Property -ComparisonOperator 'Value'".

    Example below. where Property = (Recipienttype , City), -comparisonoperator (-and), value (UserMailbox, Stockholm).

    New-DynamicDistributionGroup -Name “SUsers” -OrganizationalUnit “OUorContainerNameToCreateGroupIn” -RecipientContainer “yourdomain.com” -RecipientFilter {RecipientType -eq “UserMailbox” -and City -eq “Stockholm”}.

    Reference: New-DynamicDistributionGroup (ExchangePowerShell) | Microsoft Learn

    Please let me know if you have any further queries.

    Looking forward to your response.

    Best Regards,

    Ashraf | Microsoft Community Moderator.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments