Get a List of Shared Mailboxes Members and Permissions

If you want to get a list of members from an O365 shared mailbox using powershell, you can run either command to do so:

Get-Mailbox “Shared Mailbox Name” | Get-MailboxPermission | where {$_.user.tostring() -ne “NT AUTHORITY\SELF” -and $_.IsInherited -eq $false} | Format-Table Identity, User, AccessRights –AutoSize

OR

Get-Mailbox “Shared Mailbox name” -ResultSize:Unlimited | Get-MailboxPermission |Select-Object Identity,User,AccessRights | Where-Object {($_.user -like ‘*@*’)}|Export-Csv C:\Temp\sharedfolders.csv  -NoTypeInformation

Output example:

Get-Mailbox “Shared Mailbox Name” | Get-MailboxPermission | where {$_.user.tostring() -ne “NT AUTHORITY\SELF” -and $_.IsInherited -eq $false} | Format-Table Identity, User, AccessRights –AutoSize

Identity User AccessRights
——– —- ————
contoso.com/Exchange users/EMEA Help Desk (IT) CONTOSO\TRedmond {FullAccess}
contoso.com/Exchange users/EMEA Help Desk (IT) CONTOSO\Ito {FullAccess}
contoso.com/Exchange users/APJ Help Desk CONTOSO\TRedmond {FullAccess}
contoso.com/Exchange users/APJ Help Desk CONTOSO\Ako {FullAccess}
contoso.com/Exchange users/APJ Help Desk CONTOSO\JChen {FullAccess}
contoso.com/Exchange users/Contoso PR queries CONTOSO\TRedmond {FullAccess}
contoso.com/marketing/Marketing Queries CONTOSO\TRedmond {FullAccess}
contoso.com/marketing/Marketing Queries CONTOSO\Akers {FullAccess}