Planet PowerShell logo


Use Powershell to Find All Mailboxes a User Has Access To


Many tasks you want to accomplish in Exchange Online, either can only be done through Powershell or is ten times easier to accomplish with Powershell. One of those tasks could be that you need to figure out which shared mailboxes a user has access to. Thankfully you can accomplish this task extremely easily with Powershell. The first thing you will need to do is to get all Mailboxes in the tenant. Then find all users you have access to each mailbox. Then filter the mailboxes for if the user has access to each mailbox. It sounds a bit complicated but can be done quite simply with a Powershell one-liner.

$SharedMailboxes = Get-EXOMailbox -RecipientTypeDetails SharedMailbox -ResultSize Unlimited | Get-EXOMailboxPermission -Identity $_.Identity | Where-Object {$_.User -eq "[email protected]"}

This Powershell snippet will return a list of all the mailboxes to which the user “[email protected]” has access.

Just remember to replace “[email protected]” with the specific user in your tenant you want to look up.