Hi @Roger Roger
Check if below commands work for you:
Get-mailbox -RecipientTypeDetails UserMailbox | Select DisplayName, PrimarySmtpAddress, EmailAddresses, UserPrincipalName | Export-csv C:\test\usermailboxes.csv -NoTypeInformation
Get-mailbox -RecipientTypeDetails sharedmailbox | Select DisplayName, PrimarySmtpAddress, EmailAddresses, UserPrincipalName | Export-csv C:\test\sharedmailboxes.csv -NoTypeInformation
Get-DistributionGroup | Select DisplayName, PrimarySmtpAddress, EmailAddresses | Export-csv C:\test\DLs.csv -NoTypeInformation
Get-UnifiedGroup | Select DisplayName, PrimarySmtpAddress, EmailAddresses | Export-csv C:\test\Unifiedgroups.csv -NoTypeInformation
You will get CSV file like below:
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.