Mailbox and Distribution Access Permissions

There have been many instances where we get a request to find out which mailboxes if any does a specific mailbox has access to and what’s the access level. And also to find out out which distribution group(s) is user member of. It’s not easy to get this manually by checking the properties of each mailbox on Exchange Admin Centre especially when you have large number of mailboxes.

Following command will give you all the mailboxes that admin@test.com has access to along with access level.

Get-Mailbox | Get-MailboxPermission -user admin@test.com

If you host multiple clients, you can scope it to a specific client Organizational Unit by running the following command:

Get-Mailbox -OrganizationalUnit “OU Path” | Get-MailboxPermission -user admin@test.com

Let’s say you want to find out which Distribution Group(s) a user (admin@test.com) is a member of. Following command can be run to get that:

$username = “admin@test.com”

Get-DistributionGroup | where { (Get-DistributionGroupMember $_.Name | foreach {$_.PrimarySmtpAddress}) -contains “$Username”}

Please run the following command if you would like this to be scoped to a specific Organizational Unit.

Get-DistributionGroup -OrganizationalUnit “OU Path” | where { (Get-DistributionGroupMember $_.Name | foreach {$_.PrimarySmtpAddress}) -contains “$Username”}

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Create a website or blog at WordPress.com

Up ↑