exchange online powershell get mailbox permissions

**Get Mailbox Permissions in Exchange Online using PowerShell**

By Kevin Brown
AD

Managing mailbox permissions is a crucial aspect of Exchange Online administration. To streamline this process, Microsoft offers the Get-MailboxPermission cmdlet in PowerShell, which provides a user-friendly and efficient way to retrieve mailbox permissions. Let's delve into how to use this cmdlet effectively.

Before we proceed, ensure you have connected to your Exchange Online PowerShell using the Connect-ExchangeOnline cmdlet. This connection allows you to interact with your Exchange Online environment seamlessly.

Understanding Mailbox Permissions

The Get-MailboxPermission cmdlet retrieves mailbox permissions, which are rules that determine who can access a mailbox and what kind of access they have. Understanding these permissions is key to managing mailbox access effectively.

AD
Manage Send As Permissions using PowerShell
Manage Send As Permissions using PowerShell
Exchange Online Adds Message Recall Notifications and Settings
Exchange Online Adds Message Recall Notifications and Settings
o365info
o365info

Exchange Online supports two types of permissions: implicit and explicit. Implicit permissions are permissions inherited from the parent object, while explicit permissions are permissions assigned directly to a mailbox. The Get-MailboxPermission cmdlet helps you navigate both types of permissions.

Syntax and Basic Usage

The basic syntax for the Get-MailboxPermission cmdlet is:

How to Add a Shared Mailbox in Outlook
How to Add a Shared Mailbox in Outlook
What to Do If Your Outlook Mailbox is Full
What to Do If Your Outlook Mailbox is Full
How to Access an AOL Email Account With POP3 or IMAP - The Tech Edvocate
How to Access an AOL Email Account With POP3 or IMAP - The Tech Edvocate

Get-MailboxPermission -Identity <Identity> -AutoMapping $true | $false

Here, <Identity> refers to the mailbox for which you want to retrieve permissions. The -AutoMapping parameter controls whether the cmdlet returns permissions applied through access control lists (ACLs) or through autoresponder and forwarding mappings.

AD

Filtering and Formatting Results

You can filter the results of the Get-MailboxPermission cmdlet by using the -Filter parameter. For example, to retrieve only the permissions that grant Full Access, you can use:

Exchange Administration Quick Reference Guide PDF | Exchange Online | Hybrid | Mail Flow | IT Admin | SysAdmin
Exchange Administration Quick Reference Guide PDF | Exchange Online | Hybrid | Mail Flow | IT Admin | SysAdmin
Aliases and shared mailboxes - Journal of Accountancy
Aliases and shared mailboxes - Journal of Accountancy
Adding Calendar Permissions in Microsoft 365 and Exchange with PowerShell
Adding Calendar Permissions in Microsoft 365 and Exchange with PowerShell
Fix: Outlook Mail Not Being Marked as Read
Fix: Outlook Mail Not Being Marked as Read
a close up of a piece of paper on a table
a close up of a piece of paper on a table
How to Create Email Account on Namecheap cPanel
How to Create Email Account on Namecheap cPanel

Get-MailboxPermission -Identity <Identity> | Where-Object {$_.AccessRights -eq 'FullAccess'}

If you want to format the output in a table for easier reading, you can pipe the results to the Format-Table cmdlet. For instance:

AD

Get-MailboxPermission -Identity <Identity> | Format-Table Identity,User,AccessRights -AutoSize

Inspecting Inherited and Explicit Permissions

One of the powerful aspects of the Get-MailboxPermission cmdlet is its ability to differentiate between inherited and explicit permissions. This allows administrators to understand the full permissions picture of a mailbox.

To retrieve both inherited and explicit permissions, you can use the -Inherited parameter with a value of $true:

AD

Get-MailboxPermission -Identity <Identity> -Inherited $true

Removing Unwanted Permissions

After inspecting mailbox permissions, you might find that some permissions are no longer necessary or were granted in error. In such cases, you can use the Remove-MailboxPermission cmdlet to remove unwanted permissions:

Remove-MailboxPermission -Identity <Identity> -User <User> -AccessRights <AccessRights>

Adding Necessary Permissions

On the other hand, you might need to grant new permissions to users. This can be done using the Add-MailboxPermission cmdlet:

Add-MailboxPermission -Identity <Identity> -User <User> -AccessRights <AccessRights>

Regularly reviewing and managing mailbox permissions using the Get-MailboxPermission cmdlet helps ensure the security and integrity of your Exchange Online environment. Don't forget to test these cmdlets in a controlled environment before implementing them in your production setup.

AD