Hybrid Exchange Mailbox Magic — How msExchRemoteRecipientType=97 Automates Mailbox Type Conversion

Introduction

If you’re managing a hybrid Exchange environment, you’ve likely faced the headache of mailboxes in Exchange Online showing up as the wrong type — especially when you’ve configured the on-premises user as a Remote Shared Mailbox, but Exchange Online still treats it as a User Mailbox.

Frustrating, right?

In this blog, I’ll walk you through a simple, reliable, and supportable fix using the Active Directory attribute msExchRemoteRecipientType. Specifically, setting its value to 97 does all the heavy lifting — no need for custom Azure AD Connect sync rules, no Exchange Online PowerShell, and no manual conversions.

We’ll dive into:

  • What this attribute does
  • Why 97 is the magic number
  • How to implement it cleanly
  • Why this works (and what Microsoft says about it)

The Problem in Hybrid Environments

Let’s say you:

  • Create or convert a mailbox on-prem as a Shared Mailbox (Set-RemoteMailbox -Type Shared)
  • Expect that, after sync, it will appear in Exchange Online as a SharedMailbox

But instead:

  • It shows as a UserMailbox
  • Or worse, the mailbox doesn’t reflect any of the intended on-prem configuration

You dig into AAD Connect metaverse and see all the values look right. So why isn’t it working?

Because Exchange Online doesn’t look at all attributes, and it especially does not use msExchRecipientTypeDetails to determine the mailbox type.

What Actually Controls Mailbox Type in Exchange Online?

When syncing objects from on-premises to Exchange Online, EXO uses the following key attributes:

  • msExchRemoteRecipientType
  • targetAddress
  • ExchangeGuid
  • mail / proxyAddresses

These are evaluated during provisioning and re-evaluation cycles triggered by syncs.

The most important of these for mailbox type is msExchRemoteRecipientType. This value is a bitmask, meaning it can represent multiple flags at once.

Understanding the Magic Value: 97

So, what’s special about 97?

Let’s break it down:

97 = 64 + 32 + 1
Bit ValueDescription
1ProvisionMailbox
32RoomMailbox or TeamMailbox
64SharedMailbox

So 97 = Provision this mailbox in EXO + it’s Shared + it’s a Room or Team type.

The result? Exchange Online re-provisions or updates the mailbox correctly as a SharedMailbox

How We Applied This in Production (Real-World Fix)

We had users in our environment where on-prem:

  • Exchange showed RemoteSharedMailbox
  • AD had msExchRemoteRecipientType = 100

Yet in the cloud:

  • Mailboxes still showed as UserMailbox

So we ran this quick fix:

Set-ADUser -Identity “user@domain.com” -Replace @{msExchRemoteRecipientType=97}

Then we confirmed:

  • ExchangeGuid and targetAddress were present
  • AAD Connect sync was working (ran Start-ADSyncSyncCycle -PolicyType Delta)

And 15–30 minutes later, in Exchange Online:

Get-Mailbox -Identity “user@domain.com” | fl RecipientTypeDetails

RecipientTypeDetails : SharedMailbox

Success — no manual intervention in EXO PowerShell needed.

Bonus: You Can Flip It Back Too

Need to reverse the conversion? Just set it back:

Set-RemoteMailbox -Identity "user@domain.com" -Type Regular

This will reset msExchRemoteRecipientType back to 1 (ProvisionMailbox only), and upon sync, EXO will reflect it as a UserMailbox.

❌ What You Don’t Need to Do

Some common misconceptions:

Don’t Do ThisWhy Not
Sync msExchRecipientTypeDetailsEXO ignores it — used for filtering, not provisioning
Write custom AAD Connect sync rulesDefault rules already sync required attributes
Run Set-Mailbox -Type Shared in EXONot needed if msExchRemoteRecipientType is set right

Summary: What You Need for Automatic Mailbox Type Control

To convert mailboxes between types in a hybrid setup without touching Exchange Online PowerShell, ensure the following:

AttributeValue
msExchRemoteRecipientType97 (Shared + Team/Room + ProvisionMailbox)
ExchangeGuidMust be populated
targetAddresse.g. user@domain.mail.onmicrosoft.com
Mail-enabled

Then:

Start-ADSyncSyncCycle -PolicyType Delta

Within 30 mins, EXO should reflect the mailbox type correctly.

Final Thoughts

This method simplifies hybrid Exchange mailbox management and helps scale operations in environments with:

  • Frequent mailbox role changes
  • Automated onboarding/offboarding
  • Teams or departments that shift between Shared and User configurations

No PowerShell in EXO. No sync rule hacking. Just pure attribute magic.

Let us know if you want a ready-to-use PowerShell script to automate this in bulk for your organization.

!!! THANKS FOR READING !!!

Regards,
HARISH KUMAR

Knowledge is not a finite resource to hoard; it’s a boundless treasure that grows when shared

Leave a Comment