Manage Shared Mailbox by using PowerShell | Office 365 3.67/5 (3)

In the current article, we review the use of the PowerShell command that we use for creating and managing shared mailbox in Office 365 and Exchange Online environment.

Shared Mailbox, as the name implies, serve for storing “shared data” that we want to share among organization users.
(Shared Mailbox could use as an alternative solution for Public Folder).Before we begin, few facts about Shared Mailbox:

  1. Shared Mailbox is a unique Mailbox, that doesn’t require a license. The only limitation is that if we want to use the option of “no license” for the Shared Mailbox, the maximum mailbox size should be: 10 GB.
  2. There is no limitation on some Shared Mailboxes that can create.
  3. We cannot configure Outlook profile for the shared Mailbox (Because, by default, Shared Mailbox doesn’t have a license). The way that we use for accessing the Shared Mailbox is: by adding the Shared Mailbox as “Additional Mailbox” to the User Outlook profile, or by using OWA to open “other user Mailboxes.” (To enable users to add the Shared Mailbox to Outlook Profile, we will need to assign “Full access” permissions to the User or the Group)
  4. The PowerShell commands that we use for assigning permission to the Shared Mailbox could be implemented for a “User object” or for a “Group object” (the PowerShell command is identical for assigning permission to a user of for a group).
  5. We cannot assign permission to “Standard distribution group.” To be able to assign permissions to Group, we will need to configure the Distribution group also as a “Security Group.”

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

In our scenario, the Shared Mailbox name is: “Public MB”. We will assign the different permission to a security distribution group named – “Office users” that include office 365 users. The process of creating Shared Mailbox based on the following steps:

  1. Create the Shared Mailbox
  2. Assign a maximum size of 10 GB to the Shared Mailbox (for avoiding the need for assigning a license to the Shared Mailbox).
  3. Set Distribution group as a “Security Group” – we cannot assign permissions to the standard Distribution group.
  4. Assign permission for the users or the group that will need access to the Shared Mailbox. To enable users to access the Shared Mailbox to their mail profile, we will need to assign “Full Access” permission. To enable users to send email using the “Shared mailbox Alias”, we need to assign “Send As” permission to these users.

1. Create Shared Mailbox

1.1 – Create new Shared Mailbox

PowerShell command Syntax

PowerShell command Example

Adjustments & Customizations | Set Display name, Alias name and Email Address for the Shared Mailbox


2. Create Security Distribution Group

2.1 – Create new Security Distribution Group

PowerShell command Syntax

PowerShell command Example

Adjustments & Customizations | Set Email Address for the Distribution Group.


3. Assign permissions to Shared Mailbox

3.1 – Assign Full Access permissions for Shared Mailbox

PowerShell command Syntax

PowerShell command Example

3.2 – Assign Send As permissions for Shared Mailbox

PowerShell command Syntax

PowerShell command Example

Adjustments & Customizations | Disable the need for conformation.

3.3 – Assign Full Access & Send As permissions for Shared Mailbox + AutoMAP

When we assign to a User “Full Access” permission to another user Mailbox (Such as Shared Mailbox in our example),
The Mailbox is automatically added to the user’s Outlook mail profile. This feature described as: AutoMap.
When we assign “Full Access” permission to a Group, the AutoMap feature is not “activated,” because the permission granted to “Group Object” and not for a “User object.” In this case, we will need to instruct each of the group members how to add the “additional Mailbox manually”
For which they have “Full access” permission. To avoid this default, we can use a “Little trick”, by using a PowerShell command that “extract” group members to a “user list” and in the next, step assigns the Full Access permission separately, for each user (each of the Group members).

PowerShell command Syntax

PowerShell command Example

3.4 – Assign “ReadItems” Access permissions to the Shared Mailbox Calendar

PowerShell command Syntax

PowerShell command Example


4. Shared Mailbox Settings

4.1 – Set Shared mailbox size to 10 GB

PowerShell command Syntax

PowerShell command Example


5. Display permissions and Information for Shared Mailbox

5.1 – Display Full Access permissions for Shared Mailbox

PowerShell command Syntax

PowerShell command Example

Adjustments & Customizations | Remove System object + Self Permission from the output.

5.2 – Display Send As permissions for Shared Mailbox

PowerShell command Syntax

PowerShell command Example

Adjustments & Customizations | Remove System object + Self Permission from the output.

5.3 – Display all of the existing Shared Mailboxes

PowerShell command Syntax

Adjustments & Customizations | Remove unnecessary fields from the output.


6. Revoke permissions -Shared Mailbox

6.1 – Revoke Full Access permissions for Shared Mailbox

PowerShell command Syntax

PowerShell command Example

Adjustments & Customizations | Disable the need for conformation.

6.2 – Revoke Send As permissions for Shared Mailbox

PowerShell command Syntax

PowerShell command Example

Adjustments & Customizations: Disable the need for conformation.


7. Convert Mailbox

7.1 – Convert Regular mailbox to Shared Mailbox

PowerShell command Syntax

PowerShell command Example

7.2 – Convert Shared Mailbox to Regular Mailbox

PowerShell command Syntax

PowerShell command Example

8. Download Shared Mailbox PowerShell script

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

download-button-02.png

Watch the Video: Shared Mailbox Office 365 (Part 1 + Part 2 )

PowerShell command syntax – Office 365 | Article series index

Now it’s Your Turn!
It is important for us to know your opinion on this article


Summary
Article Name
Manage Shared Mailbox by using PowerShell | Office 365
Description
In the current article, we review the use of the PowerShell command that we use for creating and managing shared mailbox in Office 365 and Exchange Online environment.
Author
Publisher Name
o365info.com
Publisher Logo

Please rate this

Print Friendly

Related Post

Eyal Doron on EmailEyal Doron on FacebookEyal Doron on GoogleEyal Doron on LinkedinEyal Doron on PinterestEyal Doron on RssEyal Doron on TwitterEyal Doron on WordpressEyal Doron on Youtube
Eyal Doron
Share your knowledge.
It’s a way to achieve immortality.
Dalai Lama

9 Responses to “Manage Shared Mailbox by using PowerShell | Office 365”

  1. Martin Robson Reply

    Hi.

    Thank you for a great article. I’ve been struggling with Shared mailboxes, and this article has everything I need.
    Could you explain what the AutoMAP function is?

    Thank you.

    Martin Robson.

  2. Hello Martin
    Regarding your question about the “AutoMap”:
    The AutoMap feature is implemented in the following way: when you assign a “Full Access” permission to user object (for other user Mailbox), the user Mailbox is automatically appear in the user outlook mail profile.
    When we assign a “Full Access” permission to group (instead of specific user), the AutoMap feature is not implemented, and by default, we will need to add the shared Mailbox manually to each of the group members. To avoid this operation, we use a little “trick”: before we assign the permission we “extract” each of the group member name (by using the command “ExpandProperty”) and assign the “Full Access” permission separately for each member. Using this option, we are able to use the AutoMap feature when assigning permission to group.

    • ….which is the same as just adding a number of different Mailboxes with Full Access rights, so the security group -idea is futile.

      How would one remove access rights in your “trick”?

  3. I keep getting an error when trying to apply the trick to apply the rights to the distribution group. I keep getting an error stating that “Unexpected token ‘in’ in expression or statement.

Leave a Reply

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