# AADSTS50057 fix: the user account is disabled

Canonical: https://brambrinkmeier.com/entra/aadsts/50057/
By Bram Brinkmeier. JSON: https://brambrinkmeier.com/api/aadsts/50057.json

**Short answer:** AADSTS50057 means the user account is disabled in Microsoft Entra ID, so sign-in was refused. After an offboarding it is expected. The security signal is volume and source: many disabled accounts tried from one IP suggests a password spray working from an old user list. Hunt it with ResultType == "50057".

**Fix:** Admin: if the account should be active, re-enable it (Entra admin center > Users > the user > Edit properties > Account enabled). Synced users: enable it in on-premises AD and sync. When disabling, also revoke sessions. User: ask your admin; this isn't a password problem.

| Field | Value |
|---|---|
| Code | AADSTS50057 |
| Microsoft name | UserDisabled |
| Category | Credentials and lockout |
| Type | Failure |
| Attack signal | Medium: worth a look in context |
| MITRE ATT&CK | [T1110.003](https://attack.mitre.org/techniques/T1110/003/) Brute Force: Password Spraying, [T1078.004](https://attack.mitre.org/techniques/T1078/004/) Valid Accounts: Cloud Accounts |
| Where to look | `SigninLogs`, `AADNonInteractiveUserSignInLogs` |
| In Microsoft's error reference | Yes |
| Verification | lab-reproduced (2026-10-25) |
| Last updated | 2026-11-01 |

## What does AADSTS50057 mean?

Microsoft's description:

> **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

The account exists but is switched off (`accountEnabled` = false), so Entra refuses the sign-in. Microsoft's wording mentions the Active Directory object, but the code is the same for a cloud-only account disabled in Entra ID. In hybrid tenants the disable is often done on-premises and synced up, so check both places when re-enabling.

## Reproduced in the lab

On 25 October 2026 an automated lab run sent a token request with the correct password for a test user whose account was disabled. Entra returned `AADSTS50057` with this first line:

> AADSTS50057: The user account is disabled.

That confirms the code and its wording at the token endpoint.

The same attempt in the lab tenant's sign-in log (Entra admin center, interactive user sign-ins), with identifiers left out:

| Field | Value in the lab row |
|---|---|
| Status | Failure |
| Sign-in error code | 50057 |
| Failure reason | The user account is disabled. |
| Authentication details | Password (password in the cloud), succeeded: false |
| Authentication requirement | Single-factor authentication |
| Conditional Access | Not Applied |
| Client app | Mobile Apps and Desktop clients |
| Resource | Microsoft Graph |
| User type | Member |
| Cross tenant access type | None |

Two things on this page hold in the real row: Conditional Access shows **Not Applied**, because the sign-in stops before policies are evaluated, and the password check itself is recorded as not succeeded. The KQL below was run on the lab rows ([how](https://brambrinkmeier.com/methodology/)). The 14-day per-user query found both lab users. The spray query returned nothing as written, as expected for one disabled user per run; with its threshold lowered to 1 it found both source IPs.

## What is the quick fix?

If the account should be active, re-enable it. If it was disabled on purpose (leaver, retired service account), nothing is broken and the sign-in attempts are the thing to clean up.

- **Cloud-only user:** Entra admin center > Users > select the user > Edit properties > Account enabled. Or Graph: `Update-MgUser -UserId <id> -AccountEnabled:$true`.
- **Synced user:** enable the account in on-premises Active Directory, then run a sync. A cloud change is overwritten by the next sync.
- **Leaver still trying:** find the device or app retrying and remove the stale profile or token.

## Is it an attack?

Microsoft's password spray playbook lists *"50057 - User account was disabled"* among the sign-in events to review in a spray investigation. Most 50057 rows are still harmless. Read the pattern:

| Pattern | Likely meaning |
|---|---|
| One recently offboarded user, from their old device or usual IP | A phone, mail client or synced app still trying with the old account. Benign, but clean it up. |
| Rows in the non-interactive log for a leaver | An app still holding a token for that user and retrying silently. Revoke sessions. |
| Many **different disabled accounts** from one IP | In practice, a spray working from an old or leaked user list. Disabled leavers and shared mailboxes are on those lists. (T1110.003) |
| 50057 mixed with 50126 and 50034 from the same IP | The same spray hitting live, disabled and non-existent names. |
| A disabled admin or service account tried from an unfamiliar IP | Someone has a credential for an account you retired. Find out where it came from. |
| A 50057 account that suddenly shows a **success** | The account was re-enabled. Check the audit log for who did it. |

Because the account is disabled, sign-in stops at the credential stage. Expect `ConditionalAccessStatus` = `notApplied` on these rows, as Conditional Access only runs after the first factor succeeds.

## How do I find it in my logs (KQL)?

One IP trying several disabled accounts in a day:

```kusto
SigninLogs
| where TimeGenerated > ago(1d)
| where ResultType == "50057"
| summarize DisabledUsers = dcount(UserPrincipalName),
            Attempts = count(),
            Users = make_set(UserPrincipalName, 20),
            Clients = make_set(ClientAppUsed, 5)
          by IPAddress
| where DisabledUsers >= 3
| sort by DisabledUsers desc
```

What is still trying to use disabled accounts, interactive and non-interactive together:

```kusto
union SigninLogs, AADNonInteractiveUserSignInLogs
| where TimeGenerated > ago(14d)
| where ResultType == "50057"
| summarize Attempts = count(),
            FirstSeen = min(TimeGenerated),
            LastSeen = max(TimeGenerated),
            IPs = make_set(IPAddress, 10)
          by UserPrincipalName, AppDisplayName, ClientAppUsed, IsInteractive
| sort by LastSeen desc
```

The threshold of 3 in the first query is a starting point. Tune it to how many leavers you normally see.

## How do Conditional Access and MFA affect it?

- Conditional Access does not evaluate a 50057. The account is refused before CA runs.
- `AuthenticationRequirement` on these rows says nothing about whether MFA is enforced in your tenant. MFA was never reached.
- Disabling the account blocks **new** sign-ins. It does not by itself cut tokens an app already holds. Microsoft's revoke-access guidance pairs disabling the account with revoking sessions (`Revoke-MgUserSignInSession`) and already-issued access tokens keep working until they expire: by default 60 to 90 minutes.

## How do I fix AADSTS50057?

**For the user:** if you still need access, ask your admin. A disabled account is an admin decision, not a password problem. Remove old work accounts from personal phones and mail apps.

**For admins:**
1. If the account should be active, re-enable it. Microsoft's description says an admin can do this through PowerShell. In hybrid tenants, re-enable it in on-premises AD and let it sync.
2. If it is a leaver, find the device or app in the second query and remove the account from it.
3. When you disable an account for offboarding or an incident, also **revoke sessions**.
4. If the first query shows a spray, check whether the same IP produced any success, 50076/50074 or 53003 for **active** accounts. Those accounts had a correct password.

## Evidence

Reproduced in a lab tenant on 2026-10-25 (ROPC token request against a lab tenant; scenario: Account disabled). First line returned:

> AADSTS50057: The user account is disabled.

Sign-in log row read: 2026-10-30. KQL run against the exported lab rows: 2026-10-30.

Lab-run rows naming this code (9; full list at https://brambrinkmeier.com/lab-runs.json):

| Date | Scenario | Expected | Got | Message (first line) |
|---|---|---|---|---|
| 2026-10-25 | Account disabled | 50057 | 50057 | AADSTS50057: The user account is disabled. |
| 2026-10-30 | Account disabled | 50057 | 50057 | AADSTS50057: The user account is disabled. |
| 2026-10-30 | Account disabled | 50057 | 50057 | AADSTS50057: The user account is disabled. |
| 2026-10-30 | Account disabled | 50057 | 50057 | AADSTS50057: The user account is disabled. |
| 2026-10-30 | Account disabled | 50057 | 50057 | AADSTS50057: The user account is disabled. |
| 2026-10-30 | Account disabled | 50057 | 50057 | AADSTS50057: The user account is disabled. |
| 2026-10-30 | Account disabled | 50057 | 50057 | AADSTS50057: The user account is disabled. |
| 2026-10-31 | Account disabled | 50057 | 50057 | AADSTS50057: The user account is disabled. |
| 2026-10-31 | Account disabled | 50057 | 50057 | AADSTS50057: The user account is disabled. |

## Sources

1. [Access tokens in the Microsoft identity platform](https://learn.microsoft.com/en-us/entra/identity-platform/access-tokens)
2. [Microsoft Entra authentication and authorization error codes](https://learn.microsoft.com/en-us/entra/identity-platform/reference-error-codes)
3. [Password spray investigation (Microsoft incident response playbook)](https://learn.microsoft.com/en-us/security/operations/incident-response-playbook-password-spray)
4. [Revoke user access in Microsoft Entra ID](https://learn.microsoft.com/en-us/entra/identity/users/users-revoke-access)
5. [Non-interactive user sign-ins](https://learn.microsoft.com/en-us/entra/identity/monitoring-health/concept-noninteractive-sign-ins)
6. [SigninLogs table reference (Azure Monitor)](https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/signinlogs)

## Related codes

[AADSTS50126](https://brambrinkmeier.com/entra/aadsts/50126/), [AADSTS50053](https://brambrinkmeier.com/entra/aadsts/50053/), [AADSTS50034](https://brambrinkmeier.com/entra/aadsts/50034/), [AADSTS50055](https://brambrinkmeier.com/entra/aadsts/50055/), [AADSTS53003](https://brambrinkmeier.com/entra/aadsts/53003/), [AADSTS50173](https://brambrinkmeier.com/entra/aadsts/50173/), [AADSTS135011](https://brambrinkmeier.com/entra/aadsts/135011/), [AADSTS500341](https://brambrinkmeier.com/entra/aadsts/500341/), [AADSTS500571](https://brambrinkmeier.com/entra/aadsts/500571/)

## License and citation

CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). CC BY 4.0 covers the author's own text and classification fields. Quoted Microsoft error wording belongs to Microsoft, is quoted with its source and can change.

Cite as: Bram Brinkmeier, "AADSTS50057 fix: the user account is disabled", https://brambrinkmeier.com/entra/aadsts/50057/ (CC BY 4.0), last updated 2026-11-01.
