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.
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.
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}
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.
25 people are following this question.