Grant & Revoke Access to Mailboxes
There may be times where you may need to grant an IT administrator or other employees access to another user’s mailbox.
Below I will demonstrate how to:
- Grant an Admin access to a single mailbox
- Grant an Admin access to all mailboxes
- Revoke the above permissions (recommended cause of action after the Administrator has finished his/her tasks)
- First make sure you have the remote signed execution policy set to true. You can do this by running PowerShell in admin mode and running:Â Set-ExecutionPolicy RemoteSigned
- Next, run the following to authenticate your self and import PowerShell commands to your local session:
$LiveCred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange-ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
Import-PSSession $Session
Grant an Admin access to a single mailbox
Add-MailboxPermission [email protected] -User [email protected] -AccessRights FullAccess -InheritanceType All
Grant an Admin access to all mailboxes
Get-Mailbox -ResultSize unlimited -Filter {(RecipientTypeDetails -eq 'UserMailbox') -and (Alias -ne 'Admin')} | Add-MailboxPermission -User[email protected]Â -AccessRights fullaccess -InheritanceType all
Revoke the above permissions
- If you want to revoke permissions after granting them, simply replace the ‘Add-MailboxPermission‘ with ‘Remove-MailboxPermission‘ followed by the original command you entered to grant the permissions. For example, to grant [email protected] full access to [email protected], you would enter the command:
Add-MailboxPermission [email protected] -User [email protected] -AccessRights FullAccess -InheritanceType All
- To revoke [email protected] from viewing [email protected], you would enter the command:
Remove-MailboxPermission [email protected] -User [email protected] -AccessRights FullAccess -InheritanceType All
There is a switch you can use in conjunction with the above commands which will hide the user mailboxe from appearing in the mailbox-tree panel in Outlook (on the left side).
-AutoMapping $false
Author
Related Posts
Provisioning a New Office 365 User and Mailbox from Exchange Hybrid via PowerShell
Working with many Office365 clients, I receive queries on how to go about provisioning users and mailboxes for an Exchange hybrid deployment....
Add Alternate Email Address or Recovery Email Address for Office365 Administrator
In Office365, depending on the admin role of an account you may want to add an alternate email address for password recovery....
Read out all
Outlook 2016: Remove Duplicate entries in Room Finder
In Outlook 2016 some users may noticed dual entries in the Room List: The room list behavior that we see  in Outlook is by design. When we ...
Office365: List Your Business Can’t Live Without
When you have a lot of conference rooms, equipment or special rooms mailboxes it is hard to list or find available free...
Hack: Microsoft Outlook AutoComplete
Outlook maintains the AutoComplete list. The list is used by both the automatic name-checking feature and the automatic completion feature. The AutoComplete...
Read out all
Cleaning up Office365 Groups Mess
Office 365 Groups are a shared workspace for email, conversations, files, and events where group members can collectively get stuff done. It...