Add bulk users in exchange online distribution group

Gurudas 886 Reputation points
2022-09-02T13:41:33.503+00:00

Hello Team,

Please provide me powershell command to add bulk users in the o365 exchange online distribution list.

Your quick help will be much appreciated.

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,379 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,459 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. KyleXu-MSFT 26,241 Reputation points
    2022-09-05T01:28:15.627+00:00

    @Gurudas

    Glad to see you find this command.

    You could add those information below to that command, in this way, you don't need to confirm. Even if there is a problem with one mailbox, the script can still be run for other users.

    import-csv c:\temp\123.csv | foreach {Add-DistributionGroupMember -Identity "contoso_India" -Member $_.email -Confirm:$false -ErrorAction SilentlyContinue} -whatif  
    

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    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.


    1 person found this answer helpful.
    0 comments No comments

  2. Andreas Baumgarten 103.9K Reputation points MVP
    2022-09-02T14:03:54.18+00:00

    Hi @Gurudas ,

    please take a look here: https://m365scripts.com/exchange-online/add-a-user-to-multiple-distribution-lists-in-office-365-using-powershell/

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten

    0 comments No comments

  3. Gurudas 886 Reputation points
    2022-09-02T14:24:40.063+00:00

    Hello All,

    I got my answer in following kb article : https://learn.microsoft.com/en-us/powershell/module/exchange/add-distributiongroupmember?view=exchange-ps

    Powershell: import-csv c:\temp\123.csv | foreach {Add-DistributionGroupMember -Identity "contoso_India" -Member $_.email} -whatif

    Please create a csv file including all email address that needs to be added in distribution group and save it on c:\temp location

    0 comments No comments