<link href="https://fonts.googleapis.com/css?family=Roboto:100,100italic,200,200italic,300,300italic,400,400italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic&amp;display=swap" rel="stylesheet"/>
3 minutes reading time (552 words)

Creating a Shared Mailbox in an Exchange Hybrid using PowerShell

This guide will show you how to use PowerShell to create a shared mailbox in an Exchange Hybrid.

Create a shared mailbox using PowerShell

In an Exchange Hybrid with Office 365 mailboxes should be created and managed using the on-premises Exchange server

Creating mailboxes in this way means that the mailbox is created in Exchange on-premises, the user is synced to Office 365 and the AD user object has the right Exchange attributes for a Hybrid environment

  • When you create a shared mailbox, an Active Directory user object will be created and automatically disabled
  • The shared mailbox will show in your on-premises Exchange server and synced to Office 365
  • Shared mailboxes do not need an Office 365 license as they cannot be logged into

On Exchange server - open Exchange Management Shell (run as Administrator)

New-Remotemailbox -Shared -Alias TechLabsSales -OnPremisesOrganizationalUnit `
"OU=Shared Mailboxes,OU=TechLabs,DC=techlabs,DC=me,DC=uk" -Name "TechLabs Sales" `
-SamAccountName Sales -UserPrincipalName sales@techlabs.cloud -PrimarySmtpAddress sales@techlabs.cloud

New-Remotemailbox -Shared -Alias TechLabsSales -OnPremisesOrganizationalUnit `
"OU=Shared Mailboxes,OU=TechLabs,DC=techlabs,DC=me,DC=uk" -Name "TechLabs Sales" `
-SamAccountName Sales -UserPrincipalName EMAIL_ADDRESS -PrimarySmtpAddress EMAIL_ADDRESS 

New-RemoteMailbox Options

-PrimarySmtpAddress
Sets the email address you only need to use this option if you want an email address that is different from your address policy

-Archive
Creates an archive mailbox

Directory Sync

  • After a directory sync has run, the shared mailbox user will show in Office 365
  • By default AD connect directory sync runs every 30 mins
  • It might also take 20-30 mins for the shared mailbox to be created in Exchange online

To manually run a directory sync

Logon to your Azure AD connect server and run this PowerShell

Start-ADSyncSyncCycle -PolicyType Delta

Give users permissions to the shared mailbox

Exchange Online Admin Center

Recipients - Shared - select the mailbox - edit

Mailbox delegation - add the user you want to give permissions to both Full Access and Send As

Shared mailbox sent item behaviour

Check if Message Copy for Sent As is enabled for a mailbox

Connect to Exchange Online PowerShell

Get-mailbox sales@techlabs.cloud | select MessageCopyForSentAsEnabled 

Set Message Copy for Sent As to true for a mailbox

set-mailbox sales@techlabs.cloud -MessageCopyForSentAsEnabled $True

Remove a shared mailbox

On Exchange server - open Exchange Management Shell (run as Administrator)

Remove-remotemailbox –identity sales@techlabs.cloud

Related Posts

 

Comments

No comments made yet. Be the first to submit a comment
Already Registered? Login Here
Friday, 31 October 2025
You can help support this website by buying me a coffee!
Buy Me A Coffee