- Mailbox Licensing Discipline: Shared and Resource (Room/Equipment) mailboxes under 50 GB require zero license—as long as sign-in is blocked and no Archive or Litigation Hold is enabled.
- Delegation Hygiene: Always configure
-MessageCopyForSentAsEnabled $trueand-MessageCopyForSendOnBehalfEnabled $trueon shared mailboxes so replies appear in the shared Sent Items folder, not just the delegate's personal mailbox. - Modern EXO PowerShell v3: Use REST-backed
Get-EXOMailboxandGet-EXOMailboxStatisticscmdlets with Certificate-Based Auth (CBA) instead of legacy remote PowerShell (RPS) sessions.
With our tenant foundation (Chapter 1), automated Entra ID lifecycle (Chapter 2), and Zero Trust identity controls (Chapter 3) locked in, we now enter the core workload every M365 administrator manages daily: Exchange Online.
This chapter covers the architecture and PowerShell administration of User, Shared, Resource, and Online Archive mailboxes, plus Exchange Online Role-Based Access Control (RBAC) and RBAC for Applications.
1. Exchange Online Mailbox Architecture & Quota Limits
Choosing the right mailbox type prevents unnecessary licensing costs and compliance gaps.
2. Provisioning & Hardening Shared Mailboxes (The Right Way)
When you create a shared mailbox in Exchange Online, two common operational complaints immediately arise:
- Sent emails disappear into the delegate's personal Sent Items folder instead of the shared mailbox.
- Delegates with
FullAccesscomplain that Outlook slows down because Exchange Auto-Mapping forces large shared mailboxes into their cached OST file.
Use this production PowerShell snippet to provision a shared mailbox cleanly, enforce Sent Items copies, and delegate access via a mail-enabled security group (which also avoids Auto-Mapping bloat):
Connect-ExchangeOnline -ShowBanner:$false
# 1. Create the Shared Mailbox
New-Mailbox -Shared `
-Name "IT Service Desk" `
-DisplayName "IT Service Desk" `
-Alias "servicedesk" `
-PrimarySmtpAddress "[email protected]"
# 2. Ensure sent emails are saved in the Shared Mailbox's Sent Items folder
Set-Mailbox -Identity "[email protected]" `
-MessageCopyForSentAsEnabled $true `
-MessageCopyForSendOnBehalfEnabled $true
# 3. Grant FullAccess (with AutoMapping disabled for large mailboxes) & SendAs
Add-MailboxPermission -Identity "[email protected]" `
-User "[email protected]" `
-AccessRights FullAccess `
-InheritanceType All `
-AutoMapping:$false
Add-RecipientPermission -Identity "[email protected]" `
-Trustee "[email protected]" `
-AccessRights SendAs `
-Confirm:$false
3. Enabling Online Archive & Auto-Expanding Archiving
When power users approach the 100 GB primary mailbox ceiling, enabling an Online Archive offloads older email out of their local Outlook OST file while keeping it searchable in Outlook and Outlook on the Web.
# Enable Online Archive on a single mailbox
Enable-Mailbox -Identity "[email protected]" -Archive
# Enable Auto-Expanding Archiving (up to 1.5 TB) for that mailbox
Enable-Mailbox -Identity "[email protected]" -AutoExpandingArchive
# Or enable Auto-Expanding Archiving tenant-wide for all eligible EXO Plan 2 mailboxes
Set-OrganizationConfig -AutoExpandingArchive
# Trigger the Managed Folder Assistant immediately to begin moving aged items
Start-ManagedFolderAssistant -Identity "[email protected]"
Audit Mailboxes Approaching 85% Quota Capacity (EXO v3 REST Cmdlets)
$mailboxes = Get-EXOMailbox -ResultSize Unlimited -PropertySets Quota
$alerts = foreach ($mbx in $mailboxes) {
$stats = Get-EXOMailboxStatistics -Identity $mbx.UserPrincipalName -ErrorAction SilentlyContinue
if ($stats -and $stats.TotalItemSize.Value) {
$sizeGB = [math]::Round(($stats.TotalItemSize.Value.ToBytes() / GB), 2)
$quotaGB = if ($mbx.ProhibitSendQuota -match '\(([\d,]+)\sbytes\)') {
[math]::Round(([double]($matches[1] -replace ',', '') / GB), 2)
} else { 50 }
$pctUsed = if ($quotaGB -gt 0) { [math]::Round(($sizeGB / $quotaGB) * 100, 1) } else { 0 }
if ($pctUsed -ge 85) {
[PSCustomObject]@{
UPN = $mbx.UserPrincipalName
MailboxType = $mbx.RecipientTypeDetails
SizeGB = $sizeGB
QuotaGB = $quotaGB
PercentUsed = "$pctUsed%"
ArchiveState = $mbx.ArchiveStatus
}
}
}
}
$alerts | Sort-Object SizeGB -Descending | Format-Table -AutoSize
4. Configuring Resource (Room) Mailboxes cleanly
By default, Exchange Online Room Mailboxes strip the meeting subject and replace it with the organizer's name (DeleteSubject = $true). For enterprise conference rooms where visibility is desired (or where booking delegates must approve executive boardrooms), tune Set-CalendarProcessing:
New-Mailbox -Room `
-Name "Conf-Room-Executive-01" `
-DisplayName "Executive Boardroom (Floor 4)" `
-PrimarySmtpAddress "[email protected]"
Set-CalendarProcessing -Identity "[email protected]" `
-AutomateProcessing AutoAccept `
-BookingWindowInDays 180 `
-MaximumDurationInMinutes 480 `
-AllowConflicts $false `
-DeleteSubject $false `
-AddOrganizerToSubject $true `
-RemovePrivateProperty $false
5. Exchange Online RBAC & Scoped Application Permissions
Never grant Organization Management to junior admins or automation apps. Exchange Online provides two modern least-privilege layers:
- Custom Management Scopes for Human Admins: Restrict a regional Exchange admin so they can only modify mailboxes where
Department -eq 'EMEA'orCustomAttribute1 -eq 'SubsidiaryA'. - RBAC for Applications in Exchange Online: Replaces legacy Application Access Policies! Scope an Entra ID app registration (
Mail.Read,Mail.Send) so it can only access a specific security group of mailboxes—never the entire tenant.
Create a Scoped RBAC Policy for an Automation App in Exchange Online
# 1. Create a Management Scope targeting only mailboxes in a specific group
New-ManagementScope -Name "Scope-Billing-Mailboxes" `
-RecipientRestrictionFilter "MemberOfGroup -eq 'CN=SEC-Billing-Mailboxes,OU=lab365.onmicrosoft.com,OU=Microsoft Exchange Hosted Organizations,DC=NAMPR01A001,DC=prod,DC=outlook,DC=com'"
# 2. Register the Entra ID Enterprise App as an EXO Service Principal
New-ServicePrincipal -AppId "<ENTRA-APP-CLIENT-ID>" `
-ObjectId "<ENTRA-ENTERPRISE-APP-OBJECT-ID>" `
-DisplayName "Billing-Invoice-Reader-App"
# 3. Bind least-privilege Mail.Read role strictly to the Billing scope
New-ManagementRoleAssignment -App "<ENTRA-APP-CLIENT-ID>" `
-Role "Application Mail.Read" `
-CustomResourceScope "Scope-Billing-Mailboxes"
# 4. Verify the app can read a billing mailbox and is DENIED an executive mailbox
Test-ServicePrincipalAuthorization -Identity "<ENTRA-APP-CLIENT-ID>" -Resource "[email protected]"
Test-ServicePrincipalAuthorization -Identity "<ENTRA-APP-CLIENT-ID>" -Resource "[email protected]"
Chapter 4 Verification Checklist
Before advancing to Chapter 5 (Enterprise Mail Flow: Connectors, Transport Rules, Throttling & Message Trace v2), verify:
- [ ] Shared mailboxes have interactive Entra sign-in blocked (
AccountEnabled = $false) andMessageCopyForSentAsEnabledset to$true. - [ ] Mailboxes exceeding 85% quota have Online Archive and Auto-Expanding Archiving enabled.
- [ ] Room mailboxes are configured via
Set-CalendarProcessingwith clear booking windows and conflict prevention. - [ ] All automation apps accessing Exchange Online mailboxes use RBAC for Applications with explicit
ManagementScopeboundaries.
💬 Reader Comments & Feedback
Did this runbook help, or did Microsoft change a cmdlet or UI menu? Share your feedback below.
Leave a Comment or Report an Update