powershellscriptingexchange-management-shell

How to get a list of all the Shared Mailboxes that a user have access to Exchange2010 | Exchange Management Shell or PowerShell?


Get-Mailbox | Get-MailboxPermission -user

Get-Mailbox | Get-MailboxPermission -user | Where {$_.AccessRights -like "sendas*"}

Get-Mailbox | Get-ADPermission | Where {$_.extendedRights -like "send-as"}

All of the above commands does not work for me


Solution

  • I finally got it working with this script below, Run this script in Microsoft Exchange Management Shell make sure that execution policy is all granted before running the script in Management Shell

    User with full access on User Mailboxes and Shared Mailboxes

    Get-Mailbox | Get-MailboxPermission -user $user | Where {($.AccessRights -eq "FullAccess") -and -not ($.User -eq "NT AUTHORITY\SELF")} | Format-Table Identity,User

    User with Send As access

    Get-Mailbox | Get-ADPermission -user $user | Where {($.ExtendedRights -eq "*send-as*") -and -not ($.User -eq "NT AUTHORITY\SELF")} | Format-Table Identity,User