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 "chris@scriptingchris.tech"}

This Powershell snippet will return a list of all the mailboxes to which the user “chris@scriptingchris.tech” has access.

Just remember to replace “chris@scriptingchris.tech” with the specific user in your tenant you want to look up.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies. By continuing to use this site, you accept our use of cookies.