skip to Main Content

Create Office 365 shared mailbox in Exchange hybrid

It’s good to go through the Exchange hybrid test plan checklist and test all the scenarios before you start to migrate any mailboxes. The second task is to create an Office 365 shared mailbox in Exchange hybrid configuration. In this article, we will look at the only option on how to create Office 365 shared mailbox in Exchange hybrid.

Information

In this article, we will:

  1. Create Office 365 shared mailbox
  2. Test hybrid mail flow in both organizations
  3. Test GAL visibility in both organizations

There is no option to create Office 365 shared mailbox from on-premises Exchange Admin Center. Also, don’t create the shared mailbox in Office 365 Exchange admin center. If you do that, mail flow will not work as expected.

The only way to create an Office 365 shared mailbox in Exchange Hybrid is through Exchange Management Shell on-premises.

Create Office 365 shared mailbox

There are two options to create an Office 365 shared mailbox in Exchange Management Shell. You can use the cmdlets:

  • New-RemoteMailbox
  • Enable-RemoteMailbox

New-RemoteMailbox

The New-RemoteMailbox cmdlet is excellent when you don’t have an AD object in Active Directory. It will create the AD object in Active Directory and the Office 365 mailbox.

Run Exchange Management Shell as administrator. Make use of the New-RemoteMailbox cmdlet and the -Shared switch.

[PS] C:\>New-RemoteMailbox -Shared -Name "Test SharedMailbox1" -Firstname "Test" -LastName "SharedMailbox1" -UserPrincipalName "Test.SharedMailbox1@exoip.com" -OnPremisesOrganizationalUnit "OU=Shared,OU=Company,DC=exoip,DC=local"

Name                    RecipientTypeDetails     RemoteRecipientType
----                    --------------------     -------------------
Test SharedMailbox1     RemoteSharedMailbox      ProvisionMailbox, SharedMailbox

Enable-RemoteMailbox

The Enable-RemoteMailbox cmdlet is excellent when you already have an AD object in Active Directory. For example, you did a copy of another AD object, and now you want to create a shared mailbox for that AD object in Office 365.

Use the Enable-RemoteMailbox cmdlet and the -Shared switch.

[PS] C:\>Enable-RemoteMailbox -Shared "Test.SharedMailbox1" -RemoteRoutingAddress "Test.SharedMailbox1@exoip365.mail.onmicrosoft.com"

Name                    RecipientTypeDetails     RemoteRecipientType
----                    --------------------     -------------------
Test SharedMailbox1     RemoteSharedMailbox      ProvisionMailbox, SharedMailbox

Force sync Azure AD connect with PowerShell.

PS C:\> Start-ADSyncSyncCycle -PolicyType Delta

It can take some time before the shared mailbox appears in Office 365 Exchange admin center. I have seen it may take around 10 minutes.

Verify Office 365 shared mailbox

After you create the Office 365 shared mailbox, it’s good to verify that you can see the shared mailbox in both organizations.

Check user account in Active Directory Users and Computers

There are no mailboxes in Active Directory Users and Computers. The user account in AD is linked with Exchange attributes to the mailbox. Because it’s a shared mailbox, it’s disabled. That’s why you didn’t need to provide a password when creating the shared mailbox.

Check AD user account Office 365 shared mailbox

Double-click on the AD-object. Check the information in the General tab.

AD user account shared mailbox general tab

Verify the information in the Account tab.

AD user account shared mailbox account tab

Everything looks great. In the next steps, you will verify the Office 365 shared mailbox in Exchange on-premises and Exchange Online (Office 365).

Check shared mailbox in on-premises Exchange admin center

Log into the Exchange Admin Center (EAC) with admin privileges. This is on the Exchange on-premises server and NOT Office 365. Go to recipients > shared. Select the shared mailbox and click the edit icon in the toolbar.

Create Office 365 shared mailbox in Exchange hybrid exchange admin center

Click general in the menu and verify the mailbox details.

Create Office 365 shared mailbox in Exchange hybrid general

Click email address in the menu. Verify that you see:

  1. smtp:@tenant.mail.onmicrosoft.com
  2. Remote routing address
Create Office 365 shared mailbox in Exchange hybrid email address

Check shared mailbox in Microsoft 365 Exchange admin center

Go back to the Exchange admin center and click in the top bar on Office 365. Log in with your Microsoft 365 admin credentials. Click the Office 365 shared mailbox and press the edit icon in the toolbar.

You will only see Office 365 mailboxes in Microsoft 365 Exchange admin center. The on-premises mailboxes are not shown on Microsoft’s cloud servers.
Create Office 365 shared mailbox in Exchange hybrid Office 365 exchange admin center

In the menu, click on email address. There is no remote routing address option in the cloud, and you will see two smtp onmicrosoft.com email addresses:

  1. smtp:@tenant.mail.onmicrosoft.com
  2. smtp:@tenant.onmicrosoft.com
Create Office 365 shared mailbox in Exchange hybrid Office 365 email address

Get shared mailbox with Exchange Management Shell

In Exchange Management Shell, verify that the Office 365 shared mailbox is created.

[PS] C:\>Get-RemoteMailbox "Test SharedMailbox1" | ft Name,PrimarySmtpAddress,RecipientType,Remote*

Name                PrimarySmtpAddress            RecipientType RemoteRoutingAddress                                               RemoteRecipientType
----                ------------------            ------------- --------------------                                               -------------------
Test SharedMailbox1 Test.SharedMailbox1@exoip.com      MailUser SMTP:Test.SharedMailbox1@exoip365.mail.onmicrosoft.com ProvisionMailbox, SharedMailbox

Do you need more information? Use the Format-List cmdlet at the end of the command. The Format-List cmdlet formats the output of a command as a list of properties in which each property is displayed on a separate line.

[PS] C:\>Get-RemoteMailbox "Test SharedMailbox1" | fl

Get shared mailbox with Exchange Online PowerShell

Connect to Exchange Online PowerShell and verify the shared mailbox.

PS C:\> Get-Mailbox "Test SharedMailbox1" | ft Name,PrimarySmtpAddress,RecipientType,RemoteRecipientType,Database

Name                PrimarySmtpAddress            RecipientType RemoteRecipientType             Database
----                ------------------            ------------- -------------------             --------
Test SharedMailbox1 Test.SharedMailbox1@exoip.com UserMailbox   ProvisionMailbox, SharedMailbox EURP195DG038-db087

You can always use the Format-List, to get more information.

PS C:\> Get-Mailbox "Test SharedMailbox1" | fl

Test hybrid mail flow in both organizations

We did create the Office 365 test shared mailbox. Let’s test the mail from both organizations by sending an email to the Office 365 shared mailbox.

Send email from Office 365 mailbox to Office 365 shared mailbox

Start Outlook and log in with an Office 365 mailbox. Create a new message and select the Test SharedMailbox1 mailbox you created in the earlier step. Enable Request a Delivery Receipt and click Send.

Create Office 365 shared mailbox in Exchange hybrid send test mail

An email shows up in your inbox that your message has been delivered to the recipient. The mail flow from Office 365 user mailbox to Office 365 shared mailbox works.

Create Office 365 shared mailbox in Exchange hybrid message delivered

Send email from Exchange on-premises to Office 365 shared mailbox

Log in to Amanda’s on-premises mailbox. Create a new message and select the Test SharedMailbox1 mailbox you created in the earlier step. Enable Request a Delivery Receipt and click Send.

Create Office 365 shared mailbox in Exchange hybrid send test mail

An email shows up in your inbox that your message has been delivered to the recipient. The mail flow from Exchange on-premises user mailbox to Office 365 shared mailbox works.

Create Office 365 shared mailbox in Exchange hybrid message delivered

Test GAL visibility in both organizations

It’s good to test the Global Address List (GAL) visibility in Exchange Online (Office 365) and Exchange on-premises.

Office 365 Global Address List visibility

From Test Mailbox1 Outlook client, click on Address book. Select the address book All Users. Verify that you see both on-premises and Office 365 mailboxes.

Exchange hybrid Office 365 GAL visibility

Exchange on-premises Global Address List visibility

From Amanda’s Outlook client, click on Address Book. Select the address book All Users. Verify that the on-premises and Office 365 mailboxes show up.

Exchange hybrid on-premises GAL visibility

The next time, we will look at how to create Office 365 resource mailbox in Exchange hybrid configuration.

Conclusion

In this article, we looked at how to create Office 365 shared mailbox in Exchange hybrid. The only way to create Office 365 shared mailbox in Exchange hybrid is from Exchange Management Shell on-premises. Always verify your work when you are done.

You don’t have to create a shared mailbox on-premises and move to Exchange Online. Doing that will take more time, and there is no point if there is a PowerShell command.

Did you enjoy this article? You may also like the course Exchange Hybrid. Don’t forget to follow us and share this article.

ALI TAJRAN

ALI TAJRAN

ALI TAJRAN is a passionate IT Architect, IT Consultant, and Microsoft Certified Trainer. He started Information Technology at a very young age, and his goal is to teach and inspire others. Read more »

This Post Has 6 Comments

  1. Dear Ali,

    You are doing a great Job, recently i was working with customer where onprem exchange was decommissioned and they wanted to create a Shared AD sync Mailbox, we just created the mailbox and went to attribute editor and changed the msExchRecipientTypeDetail value to 2.

    Once even modify the properties as well

    Regards – Hasan Reza

  2. Hi again,
    Your first powershell code in this article has some inconsistancy! The code uses New-RemoteMailbox while the descriptive text say to run Enable-RemoteMailbox.
    My understanding is that New-RemoteMailbox will only work if there is no existing AD account for the mailbox, while Enable-RemoteMailbox will only work when there is already an AD account present for the mailbox you want to create.
    Either way, you most likely also want to add -RemoteRoutingAddress to both running the code, to actually set the remote routing address for the mailbox created.
    Per Microsoft recomodation I have first created the AD account in ADUC, waited for AAD Connect sync to finish and then run Enable-RemoteMailbox (with -RemoteRoutingAddress) in EX on-premises shell. This works, however I see that remote routing address is only set on the remote mailbox in O365 while on-premises Exchange entry does not have a remote routing address. The on-premises Exchange may not require this since the mailbox is located in Office 365, or I need to set it manually. Either way, this is not very enterprise friendly by Microsoft…

    1. Hi Chato,

      Your understanding is correct. That’s how both of the cmdlets work. I adjusted the cmdlets in the article and added extra information. Thanks for letting me know.

      Enable-RemoteMailbox cmdlet needs the -RemoteRoutingAddress parameter. New-RemoteMailbox cmdlet does not need it.

  3. Hi. Greate article. I believe you can create shared mailboxes in hybrid EX environment by creating the AD account in i.e. ADUC, wait for AAD Connect to complete syncronization, then run Enable-RemoteMailbox in on-premises Exchange with the -shared flag, using the same values used for the created user. This creates an shared mailbox tied to the ADUC account, available in both on-premises EAC and O365 EAC.

    1. Hi Chato,

      Enable-RemoteMailbox cmdlet is another approach to create shared mailboxes in Exchange hybrid.

      Note: To use the Enable-RemoteMailbox cmdlet with the -Shared switch, you need to have Exchange 2013 CU21 or later and Exchange 2016 CU10 or later.

      I updated the article.

Leave a Reply

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

Back To Top