Mailbox Permissions – PowerShell commands

MailBox Permissions PowerShell commands

Mailbox permission includes two categories:

  1. Full Access Permissions- Enable other recipient to see all of the mailbox content.
  2. Permission to send email using other recipient name (“Send As”  and “Send on Behalf” ).

Some of the Mailbox permission can be assigned by the user himself (by using the outlook or OWA interface) and the permissions to send email, using other recipient name, could only be assigned by using the PowerShell interface.

The considerable advantage of using PowerShell for managing Mailbox Permissions is that the administrator can remotely create the required setting for the user (assist users and prevent miss configurations) and using the power of the PowerShell, to execute commands in Bulk Mode (execute configuration settings for more than one Mailbox).

PowerShell | Help & additional information

In case that you are a novice in the PowerShell environment, you can use the following link to get more information about the “first steps” such as: downloading the required PowerShell
software components, how to use the PowerShell console, running a PowerShell script, etc.

Read more
Link Table
PowerShell Naming Conventions & general information

If you want to get more information about the Naming Conventions that we use for this article and get some general tips about: how to work with the PowerShell, read the article: Help and additional information – o365info.com PowerShell articles

Create remote PowerShell session

Before we can use the required PowerShell commands, we need to download and install the Office 365 cmdlets + create remote PowerShell session to Office 365 or Exchange Online. If you need more information about how to create a remote PowerShell session read the following articles: Part 2: Connect to Office 365 by using Remote PowerShell and Part 3: Connect to Exchange Online by using Remote PowerShell

How to use a PowerShell script

Most of the PowerShell articles include a PowerShell script that simplifies the use of the PowerShell commands. If you want to get more information about: How to use a PowerShell script, read the article: Connect to Office 365 and Exchange Online using a script

PowerShell command and Script languish in more details

If you are new to the PowerShell world, you can read more information about PowerShell in Office 365 environment in the article: The Power of PowerShell


Expand All Headers Collapse All Headers



1 - Assign Mailbox Permissions

Assign “Full Access” permissions for a Mailbox

PowerShell command Syntax

PowerShell command Example

Assign “Send As” Permissions for a Mailbox

PowerShell command Syntax

PowerShell command Example

Adjustments & Improvements
To avoid the need for confirmation, we can add the option: “-Confirm:$False”

Assign “Send As” Permissions for a ALL Mailbox’s (BulkMode)

PowerShell command Syntax

PowerShell command Example

Assign “Send As” Permissions for recipient for each member in a distribution group

PowerShell command Syntax

PowerShell command Example

Assign “Send As” Permissions for each member in a distribution group for a specific recipient

PowerShell command Syntax

PowerShell command Example

Assign “Send on Behalf” Permissions for a Mailbox

PowerShell command Syntax

PowerShell command Example

Assign “Full Access” permissions for all Mailboxes (BulkMode)

PowerShell command Syntax

PowerShell command Example



2 - Assign Full Access Permissions and AutoMap

Assign “Full Access” permissions to Distribution Group + AutoMap

PowerShell command Syntax

PowerShell command Example

Additional reading

Assign “Full Access” permissions for all Mailboxes (BulkMode) and Disable AutoMap

PowerShell command Syntax

PowerShell command Example

Assign “Full Access” permissions for Specific User and Disable AutoMap

PowerShell command Syntax

PowerShell command Example



3 - Display permissions for a Mailbox

Display “Full Access” Permissions for a Mailbox

PowerShell command Syntax

PowerShell command Example

Adjustments & Improvements
For improving the quality of the output we can use an additional PowerShell parameter that will “clean” the unnecessary information:

Display “Send As” permission for a Mailbox

PowerShell command Syntax

PowerShell command Example

Adjustments & Improvements
For improving the quality of the output we can use an additional PowerShell parameter that will “clean” the unnecessary information:

Display “Send On Behalf” Permissions for Mailbox

PowerShell command Syntax

PowerShell command Example

Adjustments & Improvements
For improving the quality of the output we can use an additional PowerShell parameter that will “clean” the unnecessary information:

View all “Send As permissions” you’ve configured in your organization

PowerShell command Syntax

Display a list of recipient’s that have FULL ACCESS permission on other recipient’s

PowerShell command Syntax



4 - Revoke Permissions

Revoke “Full Access” Permissions

PowerShell command Syntax

PowerShell command Example

Adjustments & Improvements
To avoid the need for confirmation, we can add the option: “-Confirm:$False”

Revoke “Send As” Permissions

PowerShell command Syntax

PowerShell command Example

Adjustments & Improvements
To avoid the need for confirmation, we can add the option: “-Confirm:$False”

For your convenience, I have “Wrapped” all the PowerShell commands that were reviewed in a PowerShell Script named: Mailbox-Permissions.ps1
You are welcome to download the script and use it.

Download

Print Friendly

 

Now it’s Your Turn!
We really want to know what you think about the article


10 Responses to “Mailbox Permissions – PowerShell commands”

  1. Anonymous Reply

    Useful collection of PS cmds. Thanks O365info!

    • Hi,

      Many thanks for the article, very helpful.
      I have one question.
      In my company we are using GMB (Generic Mailbox) for information exchange. People have access Full Access to it, also they should have Send on Behalf Of access. To simplify access, I have created Distribution List(DL), and include this DL as “Full Access” member of the GMB(with this everything is fine). I have tried to include DL into GMB Send on Behalf Of, but it didn’t find my DL via EMC. I have tried to do it via EMS, but my attempt failed.
      My command:
      Set-Mailbox -Identity “Name of GMB”-GrantSendOnBehalfTo “Name of DL”

      Could you please advise on this issue? What should I do?

      Thank you

    • Hello Irop
      The answer is that you should configure the Group (the DL) as a security group. In Exchange Online environment, you can create the security group form the Exchange Online Web management. The security group is configured automatically as mail enabled group and from the user point of view serve as a “standard distribution group”. The different between security mail enabled security group verses standard distribution group is that you cannot assign permission to distribution group. In case that you try to assign send as permission to standard distribution group (using PowerShell) you will get error such as: “User or group “DL NAME” wasn’t found. Please make sure you’ve typed it correctly.”

  2. Anonymous Reply

    Hi, in lieu of public folders being rolled out in o365, we are using a user’s mailbox as the storage area for our numerous sub-folders. We have granted the permissions using Outlook, but are experiencing problems with this – folders are not always visible even though the permissions haven’t changed (new folders/sub-folders being created and inheriting the properties of the one above). It has been suggested in the o365 community that I set the permissions using PowerShell. Are you able to assist me with the relevant commands please? I do not want to grant open access to this user’s Inbox, just to the sub-folders of that Inbox where our shared emails are stored.

    Many thanks.

  3. I try to read some information about your request.
    I have found an article (http://community.office365.com/en-us/forums/160/p/43423/147639.aspx), that suggest using the option of “Recurse”, by using the following PowerShell command
    Get-MailboxFolder –Identity : -Recurse | Add-MailboxFolderPermission -User -AccessRights Owner
    By using this option, the permission that you assign to the “parent folder” will be inherited to all of the “Child Folder” in any level.
    I little fact that was not mentioned is that to be able to use this PowerShell command you will need to create the remote PowerShell session by using the user credentials that you need to assign the permission to his folder (login as “user1” in our example)
    (You can read more information at the following link: http://technet.microsoft.com/en-us/library/dd351164.aspx )
    Generally speaking, it’s not so obvious to use a “user mailbox” to mimic the concept of a public folder.
    The next version of office 365 and Exchange online will include support in the Public folder, so maybe it’s worth to wait for a while

  4. Anonymous Reply

    congratulations and thanks for this very useful site.

  5. Anonymous Reply

    How can I get an email address (kind of UserPrincipalName) instead of User ?

    I use the cmdlet get-mail $_.user | select UserPrincipalName in a foreach but it is very very so long. Any other idea ?

    Thank you so much.

  6. thanks for all that but i want two give read only permission to two user in one time on single mailbox means i use one powershell comand

Leave a Reply

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