Back to blog

Export a list of all Mailbox Permissions in Office 365 using Powershell

Aug 30, 2012 by Emma Robinson

This Powershell script will connect to Office 365 and export all mailbox permissions to a CSV file.

If you’re short on time and need this information regularly, we recommend that you try our Office 365 Reporting software.

Read more Office 365 scripting workshop

The script only collects permissions that are non-standard, so it won’t pick up the built in groups like Administrators making for a cleaner and more relevant report.

The script accepts three parameters:

  1. Your Office 365 Administrator Username
  2. Your Office 365 Administrator Password
  3. An input file path (optional)

When you run the script without an input file specified it will connect to Office 365 and collect the mailbox permissions for all mailboxes in the tenant. It will output those to a file called MailboxPerms.csv with the following format.

UserPrincipalName,ObjectWithAccess,ObjectType,AccessType,Inherited,AllowOrDeny,Alan Byrne(,UserMailbox,FullAccess,Allow,Cogmotive Reports(,MailUniversalDistributionGroup,FullAccess,Allow

We have uploaded the script to the Microsoft Script Repository for you to download here.