#Parameters
$CSVFilePath = "C:\Temp\Bulk-DL.csv"
Try {
#Connect to Exchange Online
#Get Data from CSV and Create Distribution List
Import-CSV $CSVFilePath | ForEach {
New-DistributionGroup -Name $_.Name -PrimarySmtpAddress $_.Email -Type $_.Type -Members $_.Members.split(",")
Write-host -f Green "Created Distribution List:"$_.Name
}
}
Catch {
write-host -f Red "Error:" $_.Exception.Message
}
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article