Add bulk users in exchange online distribution group

Gurudas 951 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.

Exchange Online
Exchange Online
A Microsoft email and calendaring hosted service.
6,171 questions
Windows for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. KyleXu-MSFT 26,396 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 123.4K Reputation points MVP Volunteer Moderator
    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 951 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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.