PowerShell – List all users that have access to other mailboxes in Exchange

One of my previous customers was a company in the financial sector. Such companies have several compliancy rules and much “evidence” needs to be gathered to prove that they are compliant.

They implemented SCOM which can monitor a lot, yet still some specific reports needed to be made.
I’m not that much of a SCOM guru and that’s why I turned to PowerShell.
The request.
Create a report every night where all mailbox access is reported, specifically who has access to mailboxes other than their own and which level of access they have… and of course which mailbox it is.

Here’s the script (yes, it’s a one-liner again):

Get-Mailbox | Get-MailboxPermission | where {$_.user.tostring() -ne “NT AUTHORITY\SELF” -and $_.IsInherited -eq $false} | Select Identity,User,@{Name=’Access Rights’;Expression={[string]::join(‘, ‘, $_.AccessRights)}} | Export-Csv -NoTypeInformation mailboxpermissions.csv


  1. hans straat says:

    nice one Jeff. I retweeted it already

  2. Alan Byrne says:

    Hi Jeff, I keep meaning to get myself trained and educated on powershell because its importance when working with MSFT technologies is growing and growing, and becoming more important with each product release.  What would be your advise to get trained and up to spped with powershell asap?  Thanks @alanbyrne:twitter 

  3. Jeff Wouters says:

    Hi Alan,

    For me to provide specific information I would need to know which product or area you want to focus on.
    But To start with the basic skills, here are some books that can help you get started:

    And you could follow some peeps on Twitter that provide lots of good and handy information. I know of a few, such as @jeffhicks:twitter @powertip:twitter  @powershellguru:twitter and of course @jimposhible:twitter .
    Next to that, I started by following the hashtag #powershell for about a month and you’ll soon notice who to follow ( for your specific focus area).

    Good luck! And hope to come across one of your post 🙂


Leave a Reply

Your email address will not be published. Required fields are marked *