Fix it now
MapiExceptionLogonFailed is the Exchange store refusing a session. It is a rejection rather than a crash: the store answered and decided this logon should not proceed. Microsoft publishes no description for the exception string itself, so work from the two things that account for almost all of them – rights on the mailbox, and the state the mailbox is in.
Test-MAPIConnectivity -Server EX01
Get-MailboxDatabaseCopyStatus *
Get-Mailbox jsmith | Format-List Name,Database,RecipientTypeDetails
Get-MailboxStatistics jsmith | Format-List DisplayName,DisconnectReason,LastLogonTime
Get-MailboxPermission jsmith
- Start with
Test-MAPIConnectivity, which logs on to the system mailbox on each database and tells you whether the store is answering at all. - If that fails for a database, the mailbox is a red herring: mount the database and find out why it dismounted.
- If the store is healthy, compare the failing mailbox with one that works. Rights and mailbox state are the two variables worth checking first.
- Bind the shell to one domain controller with
Set-ADServerSettings -PreferredServer dc01.contoso.combefore you conclude anything about permissions, because replication lag produces this and explains nothing else. - Re-test after every change rather than making three and hoping.
The underlying MAPI condition is documented even though the exception name is not: 0x80040111, LogonFailed, published as “A client was unable to log on to the server.” That is the whole of what the vendor says about it.
If the operation now completes, stop here. If not, the next section separates the store, the mailbox and the caller.
Why it happens
MapiExceptionLogonFailed turns up in the management shell, in migration reports, in backup logs and in anything else that opens mailboxes on your behalf. It is worth being clear about its status: Microsoft does not publish a description for this string, or for MapiExceptionNoAccess, MapiExceptionUnexpectedMailboxState or MapiExceptionCallFailed. They are exception names from the Exchange store’s own code that surface in tooling output, and the only thing a search will find is other people guessing.
What is documented is the MAPI condition underneath. Microsoft’s error-code reference gives 0x80040111 as LogonFailed, also known as MAPI_E_LOGON_FAILED, “A client was unable to log on to the server.” That is a statement about the logon attempt, not about the network and not about the mailbox’s contents, which is enough to rule out a whole class of speculative fixes.
In practice the rejection comes from one of three places. The store itself may be unable to serve the database. The mailbox may be in a state that does not permit a logon – moving, disconnected, or soft-deleted. Or the caller may not have the rights it needs, either because they were never granted or because the grant has not replicated to the domain controller the session is bound to.
That last one is worth its own sentence, because it wastes more time than the others put together. You grant Full Access, you retry immediately, it fails, and you conclude the permission did not work. Bind the shell to the controller you made the change on with Set-ADServerSettings before you draw that conclusion.
The database is not mounted or its copy is unhealthy
You have this one if Every mailbox on one database fails while mailboxes elsewhere are fine, and Test-MAPIConnectivity fails for that database.
- Check state across the organisation with
Get-MailboxDatabaseCopyStatus *. - Mount a dismounted database with
Mount-Database, and then investigate why it dismounted rather than treating the mount as the fix. - On a database availability group, check whether a failover has left the active copy somewhere you did not expect.
- Confirm the store and replication services are running with
Test-ServiceHealth.
The caller has no rights on the mailbox
You have this one if The same operation works against another mailbox, or works when a different administrator runs it.
- List what is there:
Get-MailboxPermission <user>. - Grant what is genuinely needed:
Add-MailboxPermission -Identity <user> -User <account> -AccessRights FullAccess -InheritanceType All. - For an application that touches many mailboxes, use an impersonation role assignment rather than per-mailbox rights.
- Allow for replication, or bind the session to the controller you made the change on, before retesting.
The mailbox is in a state that cannot be opened
You have this one if MapiExceptionUnexpectedMailboxState appears, or the mailbox has a disconnect reason recorded against it.
- Read the state:
Get-MailboxStatistics <user> | Format-List DisplayName,DisconnectReason,LastLogonTime. - Check for a move in flight:
Get-MoveRequest | Get-MoveRequestStatistics. A mailbox is deliberately unavailable at the final stage of a move. - Reconnect a disconnected mailbox with
Connect-Mailboxif it should still exist. - If a soft-deleted mailbox is being opened by mistake, correct the identity being passed rather than the mailbox.
An explicit deny is blocking a privileged account
You have this one if An administrator’s account fails where an ordinary delegated account succeeds, on a mailbox nobody has changed.
- Look for deny entries:
Get-MailboxPermission <user> | Where-Object {$_.Deny -eq $true}. - Check the database level too, with
Get-ADPermission -Identity <database>. - Use a purpose-made delegated account for mailbox operations rather than a domain administrator account. Denies on privileged accounts are usually deliberate.
- If a deny was added by mistake, remove it with the matching Remove cmdlet rather than layering another allow on top of it.
The directory the session is reading is behind
You have this one if A permission you granted a minute ago is not visible, and the same command works from a different server or a few minutes later.
- Bind the session:
Set-ADServerSettings -PreferredServer dc01.contoso.com, naming the controller the change was made on. - Retry the operation in that session before concluding anything about the permission.
- Check replication health with
repadmin /replsummaryif the lag is more than a few minutes. - Remove the binding when you are done; it is a troubleshooting tool rather than a configuration.
Full reference
Four exception names, and what can honestly be said about them
| Exception | What the vendor publishes | How to treat it |
|---|---|---|
MapiExceptionLogonFailed |
Nothing | A refusal of the logon. Check store health, then rights, then mailbox state |
MapiExceptionNoAccess |
Nothing | Seen where the caller reaches the mailbox and is refused. Check rights and denies |
MapiExceptionUnexpectedMailboxState |
Nothing | Seen where the mailbox exists but is not in a state that permits the operation. Check moves and disconnect reasons |
MapiExceptionCallFailed |
Nothing | Seen where the call to the store did not complete. Check the server rather than the mailbox |
0x80040111 |
LogonFailed / MAPI_E_LOGON_FAILED: a client was unable to log on to the server | The documented condition underneath all of the above |
Separating store, mailbox and caller
| Test | What a failure tells you |
|---|---|
Test-MAPIConnectivity -Server <server> |
Logs on to each system mailbox. A failure here is the store or the database, not your mailbox |
Test-MAPIConnectivity -Database <db> |
Narrows it to one database |
Test-MAPIConnectivity -Identity <mailbox> |
Narrows it to one mailbox |
Get-MailboxDatabaseCopyStatus * |
Whether the database is mounted and its copies are healthy |
Get-MailboxStatistics <user> |
Whether the mailbox has a disconnect reason and when it last logged on |
Get-MailboxPermission <user> |
What rights exist, including denies |
Work in that order. Most of the time spent on this error is spent on the mailbox when the answer was in the first test, and the first test takes seconds.
New-MailboxRepairRequest disrupts access to the mailbox it is repairing for as long as it runs, and once a request has begun it cannot be stopped without dismounting the database. Take a backup you can restore from, run it outside working hours, and let one request finish before starting another against the same database.
When it is a migration or a backup rather than a person
- Migration tooling reports the exception from the account it is running as, not from the mailbox owner. Check the rights of that account first.
- An application that opens many mailboxes should be using an impersonation role assignment rather than Full Access on each one; per-mailbox grants drift and then fail silently for the ones that were missed.
- Backup agents often use a service account with rights granted years ago. A permission that was inherited from a container someone has since re-secured disappears without any error until the next backup.
- Where the failure names an arbitration or system mailbox rather than a user’s, treat it as a store or database problem rather than a permission one.
- Credentials stored inside a migration endpoint or a scheduled task expire independently of the account. A password change breaks them without breaking anything else.
What not to conclude
- Do not conclude the mailbox is corrupt. That is the most expensive explanation and the least likely one; check store health, rights and mailbox state first.
- Do not grant a domain administrator account Full Access to everything to get past it. If a deny is blocking a privileged account, that deny is usually deliberate.
- Do not run a mailbox repair as a first response. It is disruptive, it cannot be cancelled, and it does not address rights or database state.
- Do not read a meaning into the exception name. Microsoft publishes none, and the confident explanations in circulation are guesses.
Every code this article covers
| Code | What it points at | Source |
|---|---|---|
MapiExceptionLogonFailed |
The store refused to open a MAPI session for this caller against this mailbox. Microsoft publishes no description; the documented MAPI condition underneath is 0x80040111, “A client was unable to log on to the server” | not published by the vendor |
MapiExceptionNoAccess |
Seen where the caller reaches the mailbox and is refused. No published description; check rights and explicit denies | not published by the vendor |
MapiExceptionUnexpectedMailboxState |
Seen where the mailbox exists but is not in a state that permits the operation. No published description; check moves and disconnect reasons | not published by the vendor |
MapiExceptionCallFailed |
Seen where the call to the store did not complete. No published description; look at the server rather than the mailbox | not published by the vendor |
Confirm the fix worked
Test-MAPIConnectivity -Server <server>succeeds for every database.Get-MailboxDatabaseCopyStatus *shows the databases mounted and their copies healthy.- The operation that was failing completes, run as the account that will run it in production rather than as yours.
Get-MailboxPermission <user>shows the rights you intended and no unexpected deny.- Repeat the test from a fresh shell with no PreferredServer binding, so you know it works without the pin.
Questions people ask about this
Does fixing this cost anything?
No. Rights, database state and mailbox state are all configuration on a server you already license. Nothing on this page is resolved by a purchase.
What does MapiExceptionLogonFailed actually mean?
Microsoft does not publish a description for it. What is documented is the MAPI condition underneath, 0x80040111, LogonFailed: a client was unable to log on to the server. Treat the exception name as a label and diagnose from store health, rights and mailbox state.
Why did a permission I just granted not work?
Almost always Active Directory replication. Bind the shell to the domain controller you made the change on with Set-ADServerSettings -PreferredServer and retry before deciding the permission is wrong.
Should I run a mailbox repair?
Only after rights, database state and mailbox state have been ruled out. Microsoft’s own reference notes that the mailbox is inaccessible while the repair runs and that a request cannot be stopped once started unless you dismount the database.
Why does my migration tool hit this and Outlook does not?
Because the tool is logging on as its own service account, not as the mailbox owner. Check that account’s rights on the mailbox, and consider an impersonation role assignment instead of per-mailbox permissions.
