How to use Windows PowerShell to grant an admin access to all user mailboxes in Office 365

Applies to: Exchange Online

INTRODUCTION


This article describes how to use Windows PowerShell to grant an admin access to all user mailboxes in a Microsoft Office 365 organization through Microsoft Outlook and Outlook Web App.

PROCEDURE


To grant an admin full access to all user mailboxes in Office 365 through Outlook and Outlook Web App, follow these steps:
  1. Connect to Exchange Online by using remote PowerShell. For info about how to do this, go to the following Microsoft website:
  2. Type the following command, and then press Enter:
    Get-Mailbox -ResultSize unlimited -Filter {(RecipientTypeDetails -eq 'UserMailbox') -and (Alias -ne 'Admin')} | Add-MailboxPermission -User AdministratorAccount@contoso.com -AccessRights fullaccess -InheritanceType all 

REFERENCES


For more info about Exchange Online PowerShell, go to the following Microsoft website:For more info about the Get-Mailbox and Add-MailboxPermission Windows PowerShell cmdlets, go to the following Microsoft websites:
Still need help? Go to Microsoft Community.