#Parameters
$DistributionList = "fsiplandheri@foodserviceindia.com" # Group-Name or Group Email
$CSVFilePath = "C:\Temp\DL-Members.csv"
Try {
#Connect to Exchange Online
Connect-ExchangeOnline -ShowBanner:$False
#Get Distribution List Members and Exports to CSV
Get-DistributionGroupMember -Identity $DistributionList -ResultSize Unlimited | Select Name, PrimarySMTPAddress, RecipientType | Export-Csv $CSVFilePath -NoTypeInformation
}
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