How to add users automatically to Distribution Group based on Location?

Jean da Silva 21 Reputation points
2021-12-09T22:24:58.207+00:00

I would like to know how do you guys automate the Distribution Groups to have users added, to the onboarding process.
I know we can use Dynamic Distribution Groups, however, the problem is I can't see the members in Outlook client.
Is there any way I can use PowerShell to create a script to automatically assign a Distribution Group to a new user?
Or thinking ahead the best way is to upgrade the Distribution Groups to Office 365 groups and use dynamic membership rules?

Outlook Management
Outlook Management
Outlook: A family of Microsoft email and calendar products.Management: The act or process of organizing, handling, directing or controlling something.
4,707 questions
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.
7,196 questions
0 comments No comments
{count} votes

Accepted answer
  1. Joyce Shen - MSFT 16,626 Reputation points
    2021-12-10T02:40:09.677+00:00

    Hi @Jean da Silva

    Are you using on-prem Exchange server or Exchange online?

    1. The problem is I can't see the members in Outlook client.

    Yes, that's by design. It is not expandable because its membership is calculated when a message is sent to it.
    However we could use command to view the users in DDG.

    Get-Recipient -RecipientPreviewFilter (get-dynamicdistributiongroup <name of group>).RecipientFilter -OrganizationalUnit $group.RecipientContainer  
    

    Details:
    View members of a dynamic distribution group in Exchange Online
    Display members of dynamic distribution groups using PowerShell

    2. Is there any way I can use PowerShell to create a script to automatically assign a Distribution Group to a new user?

    If so, you will need a powershell script that creates your accounts and make adding that distribution group part of the script, and please note that we help users modify their scripts when they have an issue with it, but we don't support for writing scripts directly.

    3. upgrade the Distribution Groups to Office 365 groups and use dynamic membership rules?

    You could take a look at the operation introduced in the official document: Create or update a dynamic group in Azure Active Directory


    If an Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful