How to Create Shared Mailboxes in Exchange Online with PowerShell

Creating shared mailboxes in Exchange Online can be a powerful way to manage email communication within your organization. Shared mailboxes allow multiple users to read and send email from a common mailbox, without requiring a separate license for each user. In this blog post, we’ll walk you through the steps to create shared mailboxes using PowerShell, providing you with a streamlined approach to handle this administrative task.

Prerequisites

Before you begin, ensure that you have:

  1. Appropriate Permissions: You must have the necessary administrative rights in your Office 365 tenant to create shared mailboxes.

  2. PowerShell Modules Installed: Make sure you have the Exchange Online PowerShell module installed. You can do this by running the following commands:
    Install-Module -Name ExchangeOnlineManagement

Connecting to Exchange Online

First, you need to establish a connection to Exchange Online. Follow these steps:

  1. Open PowerShell as an administrator.

  2. Run the following command to import the module and connect to Exchange Online:
    Import-Module ExchangeOnlineManagement
    Connect-ExchangeOnline -UserPrincipalName youradmin@yourdomain.com -ShowProgress $true


    Replace youradmin@yourdomain.com with your actual admin email address.

Creating a Shared Mailbox

Once connected, you can create a shared mailbox using the New-Mailbox cmdlet. Here’s how you do it:

  1. Define the necessary parameters for your shared mailbox, such as the name and alias. For example:
    $DisplayName = “Support Team”
    $Alias = “support”


  2. Create the shared mailbox:
    New-Mailbox -Name $DisplayName -Alias $Alias -Shared

    This command creates a shared mailbox named “Support Team” with the alias “support”.

Assigning Permissions

After creating the shared mailbox, you need to assign permissions to the users who will access it. The three types of permissions are:

  1. Full Access Permission: Allows users to open and read the mailbox as well as send emails.
    Add-MailboxPermission -Identity “support” -User user1@yourdomain.com -AccessRights FullAccess -InheritanceType All

  2. Send As Permission: Allows users to send emails as the shared mailbox.
    Add-RecipientPermission -Identity “support” -Trustee user1@yourdomain.com -AccessRights SendAs

  3. Send On Behalf Permission: This access makes it clear that the email was sent by the user on behalf of the shared mailbox, indicating who actually sent the message.
    Set-Mailbox -Identity “support” -GrantSendOnBehalfTo user1@yourdomain.com

Additional Configuration

You might want to configure additional settings for the shared mailbox, such as auto-mapping or size quotas. Here are a few examples:

  1. Disable Auto-Mapping: By default, when you assign Full Access permissions, Outlook automatically maps the shared mailbox. To disable this, use:
    Set-MailboxPermission -Identity “support” -User user1@yourdomain.com -AccessRights FullAccess -AutoMapping:$false

  2. Set Mailbox Quota: To set a custom quota for the shared mailbox:
    Set-Mailbox -Identity “support” -ProhibitSendReceiveQuota 10GB -ProhibitSendQuota 9.5GB -IssueWarningQuota 9GB

Disconnecting from Exchange Online

After you’ve finished creating and configuring your shared mailbox, don’t forget to disconnect your PowerShell session:
Disconnect-ExchangeOnline -Confirm:$false

Conclusion

Using PowerShell to create shared mailboxes in Exchange Online is a powerful and efficient method, especially when managing multiple mailboxes or automating administrative tasks. By following the steps outlined above, you can easily set up and configure shared mailboxes to enhance collaboration within your organization.

If you have any questions or need further assistance, feel free to leave a comment below. Happy mailing!

Leave a Comment

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

Scroll to Top