TECHNOBABBLE

TECHNOLOGY | SECURITY | NEWS

Granting Mailbox Permissions via PowerShell – Office 365 / Exchange Online

A few months ago while troubleshooting an Exchange issue for a client running in Office 365, I realized that my account (an Exchange Online administrator) did not have administrative access to the mailboxes through the OWA in this environment. Luckily, I came across a great article on TechNet. A few Office 365 PowerShell commands later, we were back in business.

A few requirements, per MS…

The computer you use to connect to Exchange Online must be running one of the following operating systems:

  • Windows Server 2012
  • Windows Server 2008 R2 SP1
  • Windows 8
  • Windows 7 SP1
  • TCP port 80 must be open between your client computer and Exchange Online.
  • The user account you use to connect to Exchange Online must be enabled for remote Shell. For more information, see Manage Remote PowerShell Access in Exchange Online.
  • Windows PowerShell script execution must be enabled on the computer you use to connect to Exchange Online. To enable script execution for signed scripts, run the following command in an elevated Windows PowerShell window: Set-ExecutionPolicy RemoteSigned

Connecting to Exchange Online via PowerShell

  1. Open PowerShell and run the following command: $UserCredential = Get-Credential
  2. When requested, enter your user ID and password, click OK
  3. Run the following command: $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection

Assigning full administrative mailbox access via PowerShell

  1. Run the following command: Get-Mailbox -ResultSize unlimited -Filter {(RecipientTypeDetails -eq ‘UserMailbox’) -and (Alias -ne ‘Admin’)} | Add-MailboxPermission -User youraccount@contoso.com -AccessRights fullaccess -InheritanceType all

Disconnecting from Exchange Online

  1. Run the following command: Remove-PSSession $Session

You’re all set!

Anthony Adinolfi

  2 comments for “Granting Mailbox Permissions via PowerShell – Office 365 / Exchange Online

  1. Raymond Michelson
    November 6, 2015 at 4:33 PM

    Finally. Exactly what I needed… more O365 posts please, thanks Anthony Adinolfi!

Leave a Reply

Your email address will not be published. Required fields are marked *

Critical WordPress update released to patch unauthenticated privilege escalation REST API vulnerability... Would you like to know more?
+