Exchange ServerDeep dive

Removing the last Exchange server in hybrid: what's supported and how to manage recipients

All mailboxes are in Exchange Online but a server still runs just for recipient management? The supported ways to retire it, what you give up and the exact steps.

Once every mailbox lives in Exchange Online, the Exchange server left behind in many hybrid organisations has one job: editing Exchange attributes in Active Directory so directory synchronisation can carry them to the cloud. Microsoft now supports ways to stop running that server. In this post I'll compare them and walk through the management-tools route, including the mistakes that are hard to undo.

How this guide is organised: How it works → Is the management-tools route right for you? → Step-by-step → Verify → Tips and gotchasFlow diagram of the article's sections in reading order: 1. How it works. 2. Is the management-tools route right for you?. 3. Step-by-step (6 steps: Prove nothing is left on-premises; Install the management tools; Delegate recipient management; Test, shut the server down, test again; Clean up hybrid before the final shutdown; Optional: clean up Active Directory). 4. Verify. 5. Tips and gotchas. Toolbox: New-RemoteDomain, Upgrade-DistributionGroup, Get-User, proxyAddresses, targetAddress.1How it works2Is themanagement…3Step-by-step4Verify5Tips andgotchas1Prove nothingis left on-pre…2Install themanagement…3Delegaterecipient man…4Test, shut theserver down…5Clean uphybrid before…6Optional: cleanup Active Dire…TOOLBOXNew-RemoteDomainUpgrade-DistributionGroupGet-UserproxyAddressestargetAddressHow this guide is organised: How it works → Is the management-tools route right for you? → Step-by-step → Verify → Tips and gotchasFlow diagram of the article's sections in reading order: 1. How it works. 2. Is the management-tools route right for you?. 3. Step-by-step (6 steps: Prove nothing is left on-premises; Install the management tools; Delegate recipient management; Test, shut the server down, test again; Clean up hybrid before the final shutdown; Optional: clean up Active Directory). 4. Verify. 5. Tips and gotchas. Toolbox: New-RemoteDomain, Upgrade-DistributionGroup, Get-User, proxyAddresses, targetAddress.1How it works2Is the management-tools route right for you?3Step-by-step1Prove nothing is left on-premises2Install the management tools3Delegate recipient management4Test, shut the server down, test again5Clean up hybrid before the final shutdown6Optional: clean up Active Directory4Verify5Tips and gotchasTOOLBOXNew-RemoteDomainUpgrade-DistributionGroupGet-UserproxyAddressestargetAddress
At a glance: how this guide is organised · 6 steps · 5 key settings and tools

Status (October 2026): Microsoft Learn documents two supported options: the Exchange Management Tools with the Recipient Management snap-in, and cloud management of Exchange attributes for remote mailboxes, listed as generally available together with writeback through Microsoft Entra Cloud Sync. Re-check both pages before you start.

How it works: why the last server existed#

With directory synchronisation, Active Directory is the source of authority for synced users, including Exchange attributes such as proxyAddresses and targetAddress. By default Exchange Online won't edit those attributes on synced objects, and they should be changed with Exchange cmdlets, not by hand. Hence the server. The two ways out:

Management tools onlyCloud-managed Exchange attributes
Where admins workWindows PowerShell on a domain-joined machine with the Exchange Management ToolsExchange Online PowerShell or the Exchange admin center
HowThe Recipient Management snap-in writes Exchange attributes straight to AD; sync carries them to the cloudSet-Mailbox -IsExchangeCloudManaged $true moves the source of authority for that mailbox's Exchange attributes to the cloud; identity attributes stay in AD
ScopeRemote mailboxes, mail users, contacts, distribution groups, email address policies, usersMailboxes only; for groups and contacts Microsoft points to object-level source of authority transfer in Microsoft Entra ID
Fits whenAD stays the place recipients are managedAdministration moves to the cloud; writeback needs Cloud Sync

The rest of this post covers the management-tools route.

Is the management-tools route right for you?#

Microsoft's conditions, all of which must be true:

  • All mailboxes and public folders are in Exchange Online; no Exchange recipients remain on-premises.
  • You manage recipients in AD and sync with Microsoft Entra Connect Sync or Cloud Sync.
  • You don't need the on-premises Exchange admin center or Exchange RBAC, and PowerShell alone is fine.
  • You don't need auditing or logging of recipient management.
  • You're down to one Exchange server, used only for recipient management: no SMTP relay for printers or applications. If it relays, move that first (see SMTP AUTH and relay options).

What you give up:

  • RBAC. Once the last server is off, only Domain Admins and members of a new Recipient Management EMT group can manage recipients.
  • Cmdlet breadth. The snap-in covers the New/Set/Get/Remove/Enable/Disable cmdlets for MailUser, MailContact, RemoteMailbox and DistributionGroup (but not Upgrade-DistributionGroup), group membership, email address policies, and Get-User/Set-User, nothing more.
  • Script compatibility. Output types differ from remote PowerShell; for example, EmailAddresses comes back as a ProxyAddressCollection rather than an ArrayList.

Step-by-step: from last server to management tools#

1. Prove nothing is left on-premises#

PowerShell
Set-AdServerSettings -ViewEntireForest $true
Get-Mailbox -ResultSize Unlimited
Get-Mailbox -PublicFolder
Get-RemoteDomain | Where-Object TargetDeliveryDomain | Format-List Name, DomainName

Good looks like: no mailboxes, no public folder mailboxes, and your coexistence domain (contoso.mail.onmicrosoft.com) as the target delivery domain. Built-in admin mailboxes aren't synced; Microsoft says to disable them with Disable-Mailbox. Fix the domain with New-RemoteDomain and Set-RemoteDomain -TargetDeliveryDomain $true.

2. Install the management tools#

Microsoft's article describes the tools from Exchange 2019 CU12 or later. Exchange 2016 and 2019 reached end of support on 14 October 2025, so use current Exchange Server Subscription Edition (SE) setup on a domain-joined server or workstation, and install the RSAT Active Directory tools too:

Command Prompt
Setup.exe /IAcceptExchangeServerLicenseTerms_DiagnosticDataON /Role:ManagementTools

If setup needs a schema update or /PrepareAD, plan it with whoever owns AD. Scripting Agent users: copy ScriptingAgentConfig.xml from $env:ExchangeInstallPath\Bin\CmdletExtensionAgents on the server to the same folder on the tools machine.

3. Delegate recipient management#

Sign in as a Domain Admin, open Windows PowerShell (not the Exchange Management Shell) and run:

PowerShell
Add-PSSnapin *RecipientManagement
& "$env:ExchangeInstallPath\Scripts\Add-PermissionForEMT.ps1"

The script creates the Recipient Management EMT security group. Add your recipient admins to it.

4. Test, shut the server down, test again#

As a member of that group, load the snap-in (every session) and make a harmless change:

PowerShell
Add-PSSnapin *RecipientManagement
Set-RemoteMailbox test.user -EmailAddresses @{Add="smtp:test.alias@contoso.com"}
Get-RemoteMailbox test.user | Format-List PrimarySmtpAddress, RemoteRoutingAddress, EmailAddresses

Then shut down the Exchange server and repeat. Expect New- and Set- commands to pause for about 40 seconds while the admin audit log initialiser tries to reach the powered-off server; the AD clean-up in step 6 removes the delay.

5. Clean up hybrid before the final shutdown#

Turn the server on again and complete Steps 1 to 8 for Scenario 2 in Microsoft's article on decommissioning on-premises Exchange servers in a hybrid deployment. Then remove the federation trust, the federation certificate and the OAuth key credentials on the Exchange Online first-party service principal:

PowerShell
Remove-FederationTrust "Microsoft Federation Gateway"
$fed = (Get-ExchangeCertificate | Where-Object { $_.Subject -eq "CN=Federation" }).Thumbprint
Remove-ExchangeCertificate -Thumbprint $fed
.\ConfigureExchangeHybridApplication.ps1 -ResetFirstPartyServicePrincipalKeyCredentials

If you run Modern Hybrid, remove the application with Remove-HybridApplication from the agent's HybridManagement.psm1 module and uninstall the Hybrid Agent. Confirm MX and Autodiscover DNS point to Exchange Online, then shut the server down.

6. Optional: clean up Active Directory#

If you'll never run Exchange Server again, run CleanupActiveDirectoryEMT.ps1 from $env:ExchangeInstallPath\Scripts with Domain Admin rights. It removes the system mailboxes, Exchange containers you no longer need, the Exchange security groups and their permissions on the domain and configuration partitions. It can't be undone. Afterwards, wipe and reformat the old server.

Watch out: Never uninstall the last Exchange server. Uninstalling removes information from AD that the management tools need to manage Exchange attributes. Shut it down, clean up, then wipe it.

Verify#

  • A non-domain-admin member of Recipient Management EMT can run Set-RemoteMailbox, and after the next sync cycle Get-Mailbox test.user | Format-List EmailAddresses in Exchange Online PowerShell shows the change.
  • Mail flows both ways, and message trace shows no hop through the old server.
  • New Outlook profiles set up without delays or certificate prompts; if not, look for leftover Autodiscover records (see Autodiscover troubleshooting).

Tips and gotchas#

  • Patching the tools. A CU on a tools-only machine can fail, saying AD must be prepared with Setup /PrepareAD first. Run .\Setup.exe /PrepareAD /IAcceptExchangeServerLicenseTerms_DiagnosticDataON, then .\Setup.exe /m:Upgrade /IAcceptExchangeServerLicenseTerms_DiagnosticDataON, then re-run CleanupActiveDirectoryEMT.ps1 if you used it, because PrepareAD re-creates some objects. SUs install normally.
  • Remote domains. If you later need New-RemoteDomain or Set-RemoteDomain, Microsoft allows loading Microsoft.Exchange.Management.PowerShell.SnapIn for that case only.
  • Keep your own change log. Recipient changes are no longer audited, so record them in your ticketing system.

References#

Revision history: Oct 2026 — revised and re-checked against current documentation.

Written and checked against current Microsoft Learn documentation. Test changes with a pilot group before rolling them out to everyone, and if an admin center path has moved since, search for the setting name instead.

Spotted a mistake, or did this fix work differently for you? Email me or message me on LinkedIn — corrections are credited in the article.

Written by

Omer Eltayeb

Intune Subject Matter Expert in Cairo, Egypt, former Microsoft Cloud Solutions Architect, Microsoft Certified Trainer and Microsoft Innovative Educator Expert (2024–26) and Microsoft Elevate Educator Expert (2026–27). I share practical, step-by-step guides, study plans, scripts and toolkits for Microsoft Intune, Configuration Manager, Microsoft Entra ID, Microsoft Defender, Exchange and Microsoft 365 with the community.

Microsoft Certified Trainer (MCT) 2026Microsoft Innovative Educator Expert 2025–2026Microsoft Elevate Educator Expert 2026–2027ISC2 Certified Information Systems Security Professional (CISSP)Microsoft 365 Certified: Enterprise Administrator Expert (MS-102)