Powershell to Export list of Permission given to the mailbox to CSV file

If we need to get the list users who has access to the specific mailbox then below powershell help you the fetch the same. It gets all the details that have mailbox permission to the user krishna.k. It will only get the user accounts which are not inherited to the mailbox. User Permission which is given explicitly given to the mailbox

$user =”Krishna.k”
get-mailbox -identity $user| Get-MailboxPermission | ?{($_.IsInherited -eq $False) -and -not ($_.User -match “NT AUTHORITY”)}

Below powershell commming will export all the user mailbox permission of the mailbox to the CSV file. It exports all the mailbox permission which are explicit permission

Get-mailbox | Get-MailboxPermission | ?{($_.IsInherited -eq $False) -and -not ($_.User -match “NT AUTHORITY”)} |Select User,Identity,@{Name=”AccessRights”;Expression={$_.AccessRights}} | Export-csv C:\mailboxPermission.csv

 

6 thoughts on “Powershell to Export list of Permission given to the mailbox to CSV file

    • I totally agree “@{Name=”AccessRights”;Expression={$_.AccessRights}}” totally saved my bacon… and ended a half hour of googling…

  1. Anyone use this to export only mailbox permissions for a list of users?

    i.e.
    $list=Get-Content $args[0]
    forEach ($user in $list)

    Get-Mailbox -Identity $user ….

  2. can we export list of users from specific mailbox server? Let’s say if i have 4 mailbox server. I want this permission report from 1 specific mailbox server only. Can I run it in this manner?

Leave a comment