Skip to content
senn-techsenn-tech
Back to blog
Infrastruktur
Servers, Proxmox and network2026-11-20· By Franz Senn

Exchange server retired: the Mailbox Manager runs AD and Microsoft 365

An on-premises Exchange server was still running for us for one reason only: to manage mail addresses. The mailboxes have been in Exchange Online for a long time, but the users still come from on-premises Active Directory and reach Microsoft 365 through Entra Connect. In October 2026 we switched the server off and replaced it with a tool of our own, the Mailbox Manager. While tidying up we found 35 unneeded aliases and three mailboxes with a wrong routing address. Since 6 November 2026 the tool also resolves address conflicts in the cloud that made the sync fail.

The Mailbox Manager is a local web interface for managing mail addresses, aliases and licences in a hybrid environment of Active Directory and Microsoft 365. It runs as one PowerShell script on a management server, can only be reached from that server, and shows a plan before every change. Only after confirmation does it write to the directory and to the change log.

Microsoft wordmark
Microsoft describes in its documentation how to manage recipients without a running Exchange server. The starting point of this post rests on that description. (Quelle: Wikimedia Commons, public domain (trademark: Microsoft))

Where we started

When users are synchronised from on-premises AD, their mail addresses are not changed in Exchange Online. AD is the source of truth. Microsoft describes a way without a running Exchange server: the Exchange Management Tools with the recipient-management snap-in, driven from PowerShell. The route with a server remains supported, and switching it off is optional.

For daily work it was awkward. We created a new employee by copying a colleague in "Active Directory Users and Computers", running a two-line PowerShell script for the cloud mailbox, and then fixing up groups, home drive and aliases by hand. The mistakes you would expect followed. An inventory in November 2026 found 35 unneeded aliases created by the old script and three mailboxes with a wrong routing address. Mail still arrived, but each entry was a trap for the next change.

Finding on the check pageCountAs ofMeasured with
Unneeded aliases from the old script35November 2026"Check" page of the Mailbox Manager, our own AD
Mailboxes with a wrong routing address3November 2026same
Open findings after the clean-up0since the clean-upsame
Check page findings before and after the clean-upAliases before clean-up35 · 35Aliases after0 · 0Wrong routing before3 · 3Wrong routing after0 · 0040
Own measurement with the Check page of the Mailbox Manager in our own AD, November 2026. Counts are entries, not times. (Quelle: Senn-IT, own measurement, November 2026)

How the tool is built

The Mailbox Manager consists of one Windows PowerShell 5.1 script and one HTML page. There is no Node process and no web server, and the only thing to install is the Exchange Management Tools, which recipient management needs anyway. It listens on 127.0.0.1 only, and each session has its own key that appears only in the start address.

Every change first shows under "This will happen" what is going to occur, and "Confirm and apply" carries it out. The log holds time, administrator, before and after, and the result, never passwords. A read-only switch exists for the rollout and for demos.

Search page of the Mailbox Manager with one user, the primary address, the routing address and several aliases
One user at a glance: primary address, routing address and aliases. Below, aliases can be added or removed and the primary address changed. All names and addresses are made-up demo data. (Quelle: Own screenshot, demo data)

A new employee in one step

For a new employee you enter first and last name and pick a colleague as template. The tool proposes logon name, display name and mail address, and copies OU, groups and home drive from the template. It never copies protected groups such as Domain Admins. The routing address is always set by the Mailbox Manager, so it can no longer be wrong.

Form for a new employee with proposed logon name and mail address and the full plan before execution
The full plan is on screen before anything is created. The initial password is shown once and stored nowhere. (Quelle: Own screenshot, demo data)

Checking instead of searching

The "Check" page looks for the typical mistakes: wrong routing addresses, address policies still switched on, users without a mailbox. It is how we found the 35 leftovers and the three misrouted mailboxes. The list has been empty since the clean-up.

Check page with findings from Active Directory and sync errors from Microsoft 365
The check page brings AD findings and sync errors from Microsoft 365 together in one place. (Quelle: Own screenshot, demo data)

The cloud side

In November 2026 we hit a case the tool could not explain. Entra Connect reported sync errors, but AD was correct. The cause was in the cloud: two cloud-only users held addresses that the sync wanted to give to another object. Microsoft 365 allows an address only once, and while the cloud user holds it, it cannot arrive.

That became the Microsoft 365 part of the Mailbox Manager. The lookup "Who holds this address?" shows the owner in AD and every user, group, contact and deleted user in Microsoft 365 that holds the address. For a conflict, the fix is shown next to it. Sync errors from Microsoft 365 appear on the "Check" page and link to that lookup.

Only cloud-only users can be deleted and purged, never synced ones (those are deleted in AD), never your own account and never a holder of an Entra role. A deleted user keeps its addresses for another 30 days. Only "Purge" releases them, and it asks twice. Licences are assigned directly on the user, and a missing usage location is set along the way.

From the sync error to a free addressEntra Connect reportsan errorthe address does not arrivein Microsoft 365AD is correctthe address belongs to theright object thereLookup: Who holdsthis address?AD owner and every holder inMicrosoft 365A cloud-only userholds itMicrosoft 365 allows eachaddress only onceDelete with a plan,then purgepurge asks twiceNext syncthe address goes to the ADobject
The chain from the November 2026 case, as the Mailbox Manager lays it out. (Quelle: Own diagram, Mailbox Manager, November 2026)
View of an address conflict: in AD the address belongs to a group, in Microsoft 365 a cloud-only user holds it, with the delete plan below
An address conflict in one view, with the plan shown first when you delete. (Quelle: Own screenshot, demo data)
Licence assignment directly on a user in the Mailbox Manager
The licence is assigned directly on the user. (Quelle: Own screenshot, demo data)

Sign-in without stored secrets

No secret is stored on the server: no service account, no client secret, no certificate and no app registration of our own. The administrator signs in personally with MFA. The sign-in uses Microsoft's public client application "Microsoft Graph Command Line Tools" and the standard flow for native applications, authorization code with PKCE.

The tool acts with the signed-in administrator's rights and can never do more than their Entra role allows. Access tokens live in memory only and end with "Sign out" or when the tool stops. The web page never sees a token. Next to the local administrator, the log records the Microsoft 365 account that made a change.

Signing in to Microsoft 365 without a stored secretAdministrator signsinpersonally, with MFAAuthorization codewith PKCEstandard flow for nativeapplicationsToken in memory onlythe web page never sees atokenChange made with theadministrator rightsnever more than their Entrarole allowsSign out or stopthis ends the tokens
The server holds no service account, no client secret and no certificate. (Quelle: Microsoft Learn, OAuth 2.0 authorization code flow, retrieved on 20 November 2026)
Change log with time, local administrator, Microsoft 365 account, before and after
The log names the local administrator and the Microsoft 365 account. (Quelle: Own screenshot, demo data)

What we noticed while building it

Microsoft requires native applications to redirect to http://localhost. A .NET HttpListener with that prefix listened on all network interfaces for us, not only locally. We measured this before using it. Now a small dedicated receiver accepts the answer on 127.0.0.1 and ::1 only, and only during sign-in, for five minutes at most.

A local service must check the Host header as well. Without that check, a web page open in the administrator's browser could have sent requests to the tool by a detour.

Enable-RemoteMailbox with -PrimarySmtpAddress does not apply the address policy, so the new mailbox got only the primary address. The Mailbox Manager therefore sets the routing address itself and switches the policy off explicitly. Deleted also does not mean free: a deleted cloud user blocks its addresses for 30 days, and if you need them now you remove the user permanently.

The "Check" page found more leftovers than any manual pass before it. The roughly 190 automated tests (191 on 6 November 2026) only read and plan, and Microsoft Graph is simulated in them. They can run against the real directory at any time without changing anything.

Status and limits

The on-premises Exchange server is out of service. New employees, mailboxes and addresses go through the Mailbox Manager, and since 6 November 2026 so do cloud conflicts and licences. Not in the tool are disabling and deleting users in AD, resetting passwords and restoring deleted users. Existing tools cover those, and that is how it should stay.

For the background to the switch-off, Exchange Server 2016 and 2019 end of updates covers what applied at the support end in October 2026. More posts on operations and networking sit under servers and network. For tidying up a hybrid environment, IT services is where to start.

Further sources

Questions?
Does a hybrid environment still need an Exchange server?+

Only if you want to use it for recipient management. Microsoft describes a way without a running server: the Exchange Management Tools with the recipient-management snap-in, driven from PowerShell. The route with a server stays supported, and switching it off is optional.

Why does a mail address not arrive in Microsoft 365 through the sync?+

Microsoft 365 allows an address only once. If a cloud-only user, a group or a contact already holds it, Entra Connect reports a sync error even though everything is correct in on-premises AD. The address arrives once the current holder gives it up.

How long does a deleted cloud user block its addresses?+

30 days. According to Microsoft's documentation a deleted user stays restorable for that long. If you need the addresses sooner, remove the user permanently.