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

 

4 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 ….

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