Exchange Server Share

… Information sharing on Exchange Server …

Exchange Powershell Tip #09

with 4 comments

Exchange Powershell Tip #09

How to find who has Full Mailbox access and/or Send As permission on various mailboxes in your environment?

Or

How to get the list of mailboxes on which someone has Full Mailbox access and/or Send As permission ?

Here is the cmdlet to find who has Full Mailbox access on one more more mailboxes in your environment and export the result to a CSV file.

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

Sample output: (without exporting to CSV)

ExShellTip9-MailboxAccess

Here is the cmdlet to find who has Send As permission on one or more mailboxes in your environment and export the result to a CSV file.

Get-Mailbox -ResultSize Unlimited | Get-ADPermission | Where {$_.user -notlike “NT AUTHORITY\SELF” -and $_.IsInherited -eq $false -and $_.ExtendedRights -like “Send-As”} | Select Identity,User,@{Name=’Access Rights’;Expression={[String]$_.ExtendedRights}} | Export-Csv MailboxAccess.csv -NoTypeInformation

Sample output: (without exporting to CSV)

ExShellTip9-Send-As

Now main question how to find Full Mailbox Access and Send As permission both together, you can run both of above cmdlets with minor modification in a one liner to get this accomplished.

Get-Mailbox -ResultSize Unlimited | %{Get-MailboxPermission $_.Name | Where {$_.user -notlike “NT AUTHORITY\SELF” -and $_.IsInherited -eq $false} | Select Identity,User,@{Name=’Access Rights’;Expression={[string]::join(‘, ‘, $_.AccessRights)}} | Export-Csv MailboxAccess.csv -NoTypeInformation -Append; Get-ADPermission $_.Name | Where {$_.user -notlike “NT AUTHORITY\SELF” -and $_.IsInherited -eq $false -and $_.ExtendedRights -like “Send-As”} | Select Identity,User,@{Name=’Access Rights’;Expression={[String]$_.ExtendedRights}} | Export-Csv MailboxAccess.csv -NoTypeInformation -Append }

Sample output: (without exporting to CSV)

ExShellTip9-FMA-SA

Here is the output file that this one liner cmdlet generates…

ExShellTip9-XLS

==> Get All Exchange Powershell Tips from the Archive Here<==

Written by Amit Tank

June 2, 2016 at 7:56 pm

4 Responses

Subscribe to comments with RSS.

  1. Really helpful post. Great work.

    Aditya Mediratta

    August 29, 2014 at 12:22 am

  2. I use Office 365 and was hoping this would work accross our tenancy but the ,@{Name=’Access Rights’;Expression….. gives me

    Billy Smith

    September 9, 2014 at 7:00 am

  3. Oops , It leave “system.Collection.ArrayList” in the csv

    Billy Smith

    September 9, 2014 at 7:02 am


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

%d bloggers like this: