PowerShell Genie

Mailbox permissions report

Script 2 min read Windows PowerShell 5.1 and PowerShell 7

Documentation: Microsoft Learn

Inspect a mailbox’s access rights and inherited permissions with Get-EXOMailboxPermission before preparing a permissions report.

The script

1PS> $Mailbox = "shared@example.com"
2PS> Get-EXOMailboxPermission -Identity $Mailbox | Where-Object User -ne "NT AUTHORITY\SELF" | Select-Object User,AccessRights,IsInherited,Deny

Script reader

Inspect before you run

Inspection only

Inspect the script below. It does not run in this browser.

Inspection only — no command has run.

    Show reference output
    1 User AccessRights IsInherited Deny
    2 ---- ------------ ----------- ----
    3 EXAMPLE\sample.user {FullAccess} False False
    Inspect this example’s structure

    Read the command and its supplied arguments. This example requires real PowerShell or its module; this diagram does not execute it.

    $Mailbox = "shared@example.com" Get-EXOMailboxPermission -Identity $Mailbox | Where-Object User -ne "NT AUTHORITY\SELF" | Select-Object User,AccessRights,IsInherited,Deny
    1. Stage 1$MailboxPositional values or no named parameters
    2. Stage 2Where-Object-ne
    3. Stage 3Select-ObjectPositional values or no named parameters

      How it works

      Inspect a mailbox’s access rights and inherited permissions with Get-EXOMailboxPermission before preparing a permissions report. Where-Object drops the NT AUTHORITY\SELF entry that exists on every mailbox and carries no information, and the projection keeps the grantee with AccessRights, IsInherited, and the Deny flag.

      Adapting it

      Loop this across a mailbox list and add a calculated property carrying the mailbox identity, because the single-mailbox output does not name which mailbox it describes once several results are combined.

      Requirements

      ExchangeOnlineManagement module with a Connect-ExchangeOnline session.

      If the result is unexpected

      Mailbox permissions do not explain all delegate capabilities.

      FullAccess, SendAs and SendOnBehalf are different permissions with different discovery paths.

      1. Check each permission type for a known delegate rather than relying on a single mailbox-permission list.

      Validate the result

      The output labels the permission type, mailbox and trustee.

      Keep the check reliable

      Keep permission types separate in reports and verify changes against the corresponding property or command.

      Primary documentation

      PowerShell objects and pipelines documentation

      Continue
      Genie guideMailbox permissions report

      Inspect a mailbox’s access rights and inherited permissions with Get-EXOMailboxPermission before preparing a permissions report.