How to Create a Shared Mailbox in Exchange Online
Step-by-step guide to creating a shared mailbox in Microsoft 365 — from the admin center, the Exchange admin center, or PowerShell — plus permissions and licensing rules.
TL;DR: In the Exchange admin center at https://admin.exchange.microsoft.com, go to Mail flow > Rules > + Add a rule > Create a new rule. Set conditions (“Apply this rule if…”), actions (“Do the following…”), optional exceptions, name it descriptively, and save. New or modified rules can take up to 30 minutes to take effect.
Mail flow rules — formerly called transport rules — are how you intercept and act on email as it moves through Exchange Online. They run on every message (other than NDRs and a handful of system messages) and can rewrite, redirect, block, encrypt, or stamp messages based on dozens of conditions.
A mail flow rule has three parts:
When a message matches all conditions and none of the exceptions, every action listed runs. You can chain rules with the Stop processing more rules action, or let the priority order decide.
[EXTERNAL] subject prefixWe’ll build the most common rule: prefix [EXTERNAL] to the subject of inbound messages from outside the organization. This is one of the highest-leverage anti-phishing controls a tenant can deploy.
Select + Add a rule > Create a new rule.
You can also pick a template from the Add a rule dropdown for common scenarios — disclaimers, encryption, classification — and tweak from there.
On the Set rule conditions page:
External email subject prefix (be specific so it’s obvious in the rule list later).This matches every message originating from outside your verified domains.
[EXTERNAL] (include the trailing space).For this rule, exclude messages where the prefix is already present, so replies don’t end up with [EXTERNAL] [EXTERNAL] [EXTERNAL] Re: … after a few rounds:
[EXTERNAL].Optional second exception: skip messages from trusted partner domains where the prefix would be noise:
Review the summary; select Finish to save.
The new rule appears in the Rules list. Rules run in priority order (lowest number first); to reorder, drag rules in the list or set Priority explicitly. It can take up to 30 minutes for a new or modified rule to start applying to messages.
From an external account (a personal Gmail, your phone), send a test message to a mailbox in your tenant. The subject should arrive as [EXTERNAL] <original subject>. Reply from the internal mailbox; the reply should land back at Gmail without the prefix being doubled.
| Goal | Condition | Action |
|---|---|---|
| Prefix external mail | Sender is outside the organization | Prepend subject with [EXTERNAL] |
| Block executable attachments | Attachment file extension matches exe, scr, bat, ps1, vbs, js |
Reject the message with explanation |
| Bypass spam filtering for a trusted vendor (rare) | Sender’s domain is trusted-partner.com AND IP is in 198.51.100.0/24 |
Set the SCL to -1 |
| Force encryption on PII | Message contains pattern matching SSN regex | Apply Microsoft Purview Message Encryption |
| Route to journal for retention | Recipient is in the legal-hold group | Bcc to journal mailbox |
| Disclaimer on outbound | Sender is internal | Append disclaimer (HTML) |
When matching SCL or sender IP, scope tightly — wide rules with Set the SCL to -1 are how phishing actors bypass anti-spam.
For scripted or repeatable rule creation:
Connect-ExchangeOnline
# The same [EXTERNAL] subject prefix rule
New-TransportRule `
-Name "External email subject prefix" `
-FromScope "NotInOrganization" `
-ExceptIfSubjectContainsWords "[EXTERNAL]" `
-PrependSubject "[EXTERNAL] " `
-Mode Enforce
To list all rules:
Get-TransportRule | Format-Table Name, State, Priority, Mode -AutoSize
To export every rule for backup or migration:
Get-TransportRule |
Export-Clixml -Path .\transport-rules-backup.xml
Step-by-step guide to creating a shared mailbox in Microsoft 365 — from the admin center, the Exchange admin center, or PowerShell — plus permissions and licensing rules.