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
That’s incredibly useful. Especially this little expression “@{Name=”AccessRights”;Expression={$_.AccessRights}}”
I totally agree “@{Name=”AccessRights”;Expression={$_.AccessRights}}” totally saved my bacon… and ended a half hour of googling…
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 ….
Wonderful
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?
@James,
Did you get a response to your question? I desperately need just the list in a file using the UserPrincipalName