Powershell – Exchange – Find which mailboxes a user has access to

Although it is quite easy to find the access that users have to a specific individual mailbox, it is much more difficult to do the reverse and find which mailboxes a user has access to.

Notes

  1. Replace Domain\User with the name of the user you are checking
  2. Using the Get-Mailbox  command in an unrestricted fashion can be resource intensive if you have a lot of mailboxes to search through. Please be aware of this and take precaution when running the command
  3. If you are not running the command on an Exchange server you will need to import the Powershell Exchange snapin or module depending on the version of Exchange
  4. Pipe to Export-Csv -path $ExportPath -Append -NoTypeInformation to export the results to CSV

Code description

  1. Get-Mailbox -ResultSize Unlimited will search the Exchange environment for all mailboxes without any result limits and then pipe the results to Get-MailboxPermission
  2. Mailbox permissions are then found and filtered to only show mailboxes that your user has access to

Code

Get-Mailbox -ResultSize Unlimited | Get-MailboxPermission | Select Identity, User | Where {$_.User -like "Domain\User"}
Advertisements

2 thoughts on “Powershell – Exchange – Find which mailboxes a user has access to

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s