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:
- Appropriate Permissions: You must have the necessary administrative rights in your Office 365 tenant to create shared mailboxes.
- 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:
- Open PowerShell as an administrator.
- Run the following command to import the module and connect to Exchange Online:
Import-Module ExchangeOnlineManagement
Connect-ExchangeOnline -UserPrincipalName youradmin@yourdomain.com -ShowProgress $true
Replaceyouradmin@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:
- Define the necessary parameters for your shared mailbox, such as the name and alias. For example:
$DisplayName = “Support Team”
$Alias = “support” - 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:
- 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 - Send As Permission: Allows users to send emails as the shared mailbox.
Add-RecipientPermission -Identity “support” -Trustee user1@yourdomain.com -AccessRights SendAs - 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:
- 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 - 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!