AADSTS50057 (UserDisabled): Sign-In to a Disabled Account
Published · Updated
Entra ID refused the sign-in because the account is disabled; the code does not say whether the password was right, so repeated attempts on leaver accounts deserve a look at where they came from.
Did the attacker have the password? Cannot tell from this code alone — correlate with the events around it.
Microsoft's definition
UserDisabled
UserDisabled - The user account is disabled. The user object in Active Directory backing this account has been disabled. An admin can re-enable this account through PowerShell
Source: Microsoft Entra authentication and authorization error codes · checked against the published table on every build · look up another code
Where it appears
- Microsoft Sentinel / Log Analytics: the ResultType column of SigninLogs and AADNonInteractiveUserSignInLogs
- Microsoft Graph signIns API and JSON exports: status.errorCode, with the text in status.failureReason
- Entra admin center sign-in log download (CSV): the Sign-in error code column
- 1 Stops here
Account
Exists, is enabled, is not locked out or blocked
- 2
Password
The password or other first factor is checked
- 3
Conditional Access
Policies, risk included, block or require more
- 4
MFA
The second factor is completed, or registered
- 5
Signed in
A token is issued; ResultType 0
Microsoft: “Conditional Access policies are enforced after first-factor authentication is completed.” Conditional Access overview ↗︎
What it means
Entra ID found the account — so unlike AADSTS50034, the name is real — and refused the sign-in because the account object is disabled. Microsoft’s wording is that “The user account is disabled. The user object in Active Directory backing this account has been disabled. An admin can re-enable this account through PowerShell”. In a hybrid tenant the disabled state normally originates on the on-premises user object and arrives through directory synchronisation; in a cloud-only tenant it is set directly on the Entra ID user.
What the code does not tell you is whether the password that was submitted was correct. The failure reason is about the state of the account, not about the credentials, so a 50057 is neither proof that the password was wrong nor proof that it worked. That is why the source matters more than the count here.
Is it an attack?
| Pattern | Reading |
|---|---|
| One disabled account, failures at regular intervals from an internal host or office IP | Leftover stored credential — a service, scheduled task, mapped drive or mail profile that was never cleaned up at offboarding |
| One leaver’s account from a residential, mobile or VPN address, a few times a day | The former employee still has the password saved, or someone else does |
| 50057 mixed with AADSTS50034 and AADSTS50126 from one source across many names | Spraying or stuffing against a stale list; the 50057 entries are the names that were real |
| 50057 for a privileged or break-glass-adjacent account from anywhere unfamiliar | Treat as targeted — someone knows which account used to hold that role |
| 50057 for an account, then a success for the same account days later | The account was re-enabled. Confirm who did it and why (T1098) |
Legacy authentication protocols are worth checking on every one of these, because clients that cannot be challenged are exactly what stored-credential and spraying activity tends to use — see the legacy-auth MFA bypass rule.
How to investigate
Start with which disabled accounts are still being used and by what:
SigninLogs
| where TimeGenerated > ago(14d)
| where ResultType == "50057"
| summarize Attempts = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated),
Apps = make_set(AppDisplayName, 10), Clients = make_set(ClientAppUsed, 10),
Sources = make_set(IPAddress, 20), Where = make_set(Location, 10)
by UserPrincipalName
| order by Attempts desc
Run the same query against AADNonInteractiveUserSignInLogs; background clients retrying an old password rarely show up in the interactive table.
Then pivot to the source and answer the question that sets the severity — did that address ever succeed for anything?
let lookback = 14d;
let wins = SigninLogs
| where TimeGenerated > ago(lookback) and ResultType == "0"
| summarize Successes = count(), SucceededFor = make_set(UserPrincipalName, 20) by IPAddress;
SigninLogs
| where TimeGenerated > ago(lookback) and ResultType == "50057"
| summarize DisabledHits = count(), DisabledAccounts = dcount(UserPrincipalName),
AccountList = make_set(UserPrincipalName, 20), Clients = make_set(ClientAppUsed, 5)
by IPAddress, Location
| join kind=leftouter wins on IPAddress
| where DisabledAccounts > 1
| project IPAddress, Location, DisabledHits, DisabledAccounts, AccountList, Clients,
Successes, SucceededFor
| order by DisabledAccounts desc
If the source is internal and the pattern is clockwork, find the host and clear the saved credential. If it is external, confirm the account is still meant to be disabled, review the directory audit log for any change that re-enabled it or altered its authentication methods, and check whether the same IP appears against live accounts with AADSTS50126 or AADSTS50053 — that turns one stale-account failure into evidence of a wider spray.
Related codes
- AADSTS50034 UserAccountNotFound Entra ID could not find the account the sign-in asked for, so no password was ever checked; a run of these from one source is username enumeration against your tenant.
- AADSTS50126 InvalidUserNameOrPassword Entra ID rejected the password (or the username) for this sign-in. One failure is a typo; the same failure across many accounts from one IP is password spraying.
- AADSTS50053 This error can result from two different reasons: IdsLocked Entra ID refused the sign-in before accepting it: either smart lockout has locked the account after repeated failures, or the source IP was blocked for malicious activity.
- AADSTS50055 InvalidPasswordExpiredPassword The account's password has expired, so Entra ID ended the sign-in and offered a password reset — routine for a user, a broken job for a service account, and a concern when the sign-in came from somewhere the user has never been.
- AADSTS53003 BlockedByConditionalAccess A Conditional Access policy blocked the sign-in. Conditional Access is enforced after first-factor authentication completes, so for an interactive sign-in an unexpected 53003 usually means the password was right.
Detect it
Frequently Asked Questions
- Does AADSTS50057 mean the attacker had the correct password?
- It does not say either way. Microsoft's description for this code covers only the state of the account — it is disabled — and unlike AADSTS50126 it makes no statement about the credentials that were submitted. Treat the password as unknown and let the source address, client and the account's history decide the severity.
- Why do we still get AADSTS50057 for an account we disabled months ago?
- Something is still presenting that account's stored credentials. Mail clients on phones, mapped drives, scheduled tasks, service hosts and scripts keep retrying long after offboarding. Check ClientAppUsed, AppDisplayName and IPAddress on the failing entries, and look in AADNonInteractiveUserSignInLogs as well — background clients often appear only there.
- What is the difference between AADSTS50057 and AADSTS50034?
- AADSTS50034 means Entra ID could not find the account at all, so the name is wrong or invented. AADSTS50057 means the account exists and was deliberately disabled. For an attacker probing names, a 50057 confirms the account is real, which is why bursts mixing the two codes from one source are usually enumeration or spraying against an old list.
- One IP produced AADSTS50057 for several different accounts — how bad is that?
- It means someone is working through a list of names that includes your leavers, which points at an old credential dump or scraped directory rather than a current one. The question that sets the severity is whether that same IP ever produced a success: if it did, start there, and check whether the attempts used legacy authentication protocols that bypass modern controls.
Find AADSTS50057 in your own logs
Drop an Entra ID sign-in export into the free browser analyzer to see which users and IPs hit this code (nothing is uploaded), or run it through LogTriage for threat-intel enrichment and an AI-written incident report.