Distribution Lists

Glenn Maxwell 10,146 Reputation points
2022-04-21T18:24:59.073+00:00

Hi All
i am using exchange 2016 hybrid environment. i want to create 10 Onprem DL and 10 Online DLs. i have excel sheet in the below format.
Experts guide me how to import the excel file and create the DLs.

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,174 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,345 questions
Microsoft Exchange Hybrid Management
Microsoft Exchange Hybrid Management
Microsoft Exchange: Microsoft messaging and collaboration software.Hybrid Management: Organizing, handling, directing or controlling hybrid deployments.
1,884 questions
0 comments No comments
{count} votes

Accepted answer
  1. Joyce Shen - MSFT 16,641 Reputation points
    2022-04-22T01:53:54.423+00:00

    Hi @Glenn Maxwell

    You could save the data to a CSV file, and store it in a location on your PC (e.g. C:\test\group.csv ), then you could use the command below to create the groups in bulk:

    For on-prem:

    Import-CSV “C:\test\group.csv” | foreach {New-DistributionGroup -Name $_.Name -Alias $_.Alias -DisplayName $_.Displayname -SamAccountName $_.SamAccountName -OrganizationalUnit $_.OrganizationalUnit}  
    

    195411-image.png
    195339-image.png

    For Online, note that the -SamAccountName is available only in on-premises Exchange. And you need to connect to exchange online powershell firstly

    Import-CSV “C:\test\group.csv” | foreach {New-DistributionGroup -Name $_.Name -Alias $_.Alias -DisplayName $_.Displayname}  
    

    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 comments No comments

0 additional answers

Sort by: Most helpful