How to get a list of all the distribution groups a mailbox is a member of in Microsoft 365
You can do this easily with the https://admin.microsoft.com via Active Users. However, if you have especially multiple users to check Powershell comes very handy.
First install the Exchange Online module:
Install-Module ExchangeOnlineManagement
Once the module is installed, you can use
Connect-ExchangeOnline
to establish the connection, enter your credentials at the prompt. Then you can run
Get-DistributionGroup | where { (Get-DistributionGroupMember $_.Name | foreach {$_.PrimarySmtpAddress}) -contains "email@example.com"}
This will get you the list of distribution groups that email@example.com is a member of. You can of course format the output to your liking.
Leave a Reply