question

GlennMaxwell-2309 avatar image
0 Votes"
GlennMaxwell-2309 asked emilyhua-msft edited

Distribution Lists

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.

office-exchange-server-administrationoffice-exchange-online-itprooffice-exchange-hybrid-itpro
onprem.jpg (23.0 KiB)
online.jpg (15.8 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

joyceshen-MSFT avatar image
0 Votes"
joyceshen-MSFT answered

Hi @GlennMaxwell-2309

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.



image.png (8.1 KiB)
image.png (6.1 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.