{
  "schemaVersion": "1.0",
  "code": "50057",
  "name": "UserDisabled",
  "title": "AADSTS50057 fix: the user account is disabled",
  "url": "https://brambrinkmeier.com/entra/aadsts/50057/",
  "alternates": {
    "markdown": "https://brambrinkmeier.com/entra/aadsts/50057.md",
    "json": "https://brambrinkmeier.com/api/aadsts/50057.json",
    "html": "https://brambrinkmeier.com/entra/aadsts/50057/"
  },
  "description": "AADSTS50057 means the Entra ID account is disabled. How to re-enable a cloud or synced account, and when many 50057s mean a password spray.",
  "summary": "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\".",
  "inMicrosoftReference": true,
  "unlistedChecked": null,
  "meaningText": "Microsoft's description:\n\n> **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\n\nThe 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.",
  "sections": [
    {
      "heading": "What does AADSTS50057 mean?",
      "text": "Microsoft's description:\n\n> **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\n\nThe 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."
    },
    {
      "heading": "Reproduced in the lab",
      "text": "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:\n\n> AADSTS50057: The user account is disabled.\n\nThat confirms the code and its wording at the token endpoint.\n\nThe same attempt in the lab tenant's sign-in log (Entra admin center, interactive user sign-ins), with identifiers left out:\n\n| Field | Value in the lab row |\n|---|---|\n| Status | Failure |\n| Sign-in error code | 50057 |\n| Failure reason | The user account is disabled. |\n| Authentication details | Password (password in the cloud), succeeded: false |\n| Authentication requirement | Single-factor authentication |\n| Conditional Access | Not Applied |\n| Client app | Mobile Apps and Desktop clients |\n| Resource | Microsoft Graph |\n| User type | Member |\n| Cross tenant access type | None |\n\nTwo 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."
    },
    {
      "heading": "What is the quick fix?",
      "text": "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.\n\n- **Cloud-only user:** Entra admin center > Users > select the user > Edit properties > Account enabled. Or Graph: `Update-MgUser -UserId <id> -AccountEnabled:$true`.\n- **Synced user:** enable the account in on-premises Active Directory, then run a sync. A cloud change is overwritten by the next sync.\n- **Leaver still trying:** find the device or app retrying and remove the stale profile or token."
    },
    {
      "heading": "Is it an attack?",
      "text": "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:\n\n| Pattern | Likely meaning |\n|---|---|\n| 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. |\n| Rows in the non-interactive log for a leaver | An app still holding a token for that user and retrying silently. Revoke sessions. |\n| 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) |\n| 50057 mixed with 50126 and 50034 from the same IP | The same spray hitting live, disabled and non-existent names. |\n| 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. |\n| A 50057 account that suddenly shows a **success** | The account was re-enabled. Check the audit log for who did it. |\n\nBecause 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."
    },
    {
      "heading": "How do I find it in my logs (KQL)?",
      "text": "One IP trying several disabled accounts in a day:\n\n```kusto\nSigninLogs\n| where TimeGenerated > ago(1d)\n| where ResultType == \"50057\"\n| summarize DisabledUsers = dcount(UserPrincipalName),\n            Attempts = count(),\n            Users = make_set(UserPrincipalName, 20),\n            Clients = make_set(ClientAppUsed, 5)\n          by IPAddress\n| where DisabledUsers >= 3\n| sort by DisabledUsers desc\n```\n\nWhat is still trying to use disabled accounts, interactive and non-interactive together:\n\n```kusto\nunion SigninLogs, AADNonInteractiveUserSignInLogs\n| where TimeGenerated > ago(14d)\n| where ResultType == \"50057\"\n| summarize Attempts = count(),\n            FirstSeen = min(TimeGenerated),\n            LastSeen = max(TimeGenerated),\n            IPs = make_set(IPAddress, 10)\n          by UserPrincipalName, AppDisplayName, ClientAppUsed, IsInteractive\n| sort by LastSeen desc\n```\n\nThe threshold of 3 in the first query is a starting point. Tune it to how many leavers you normally see."
    },
    {
      "heading": "How do Conditional Access and MFA affect it?",
      "text": "- Conditional Access does not evaluate a 50057. The account is refused before CA runs.\n- `AuthenticationRequirement` on these rows says nothing about whether MFA is enforced in your tenant. MFA was never reached.\n- 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."
    },
    {
      "heading": "How do I fix AADSTS50057?",
      "text": "**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.\n\n**For admins:**\n1. 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.\n2. If it is a leaver, find the device or app in the second query and remove the account from it.\n3. When you disable an account for offboarding or an incident, also **revoke sessions**.\n4. 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."
    }
  ],
  "microsoftWording": {
    "text": "**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's error code reference, as quoted on the page",
    "sourceUrl": "https://learn.microsoft.com/en-us/entra/identity-platform/reference-error-codes"
  },
  "securityReading": {
    "category": {
      "id": "credentials",
      "label": "Credentials and lockout"
    },
    "kind": {
      "id": "failure",
      "label": "Failure"
    },
    "attackSignal": {
      "level": "medium",
      "label": "Medium: worth a look in context"
    },
    "mitre": [
      {
        "id": "T1110.003",
        "name": "Brute Force: Password Spraying",
        "url": "https://attack.mitre.org/techniques/T1110/003/"
      },
      {
        "id": "T1078.004",
        "name": "Valid Accounts: Cloud Accounts",
        "url": "https://attack.mitre.org/techniques/T1078/004/"
      }
    ],
    "tables": [
      "SigninLogs",
      "AADNonInteractiveUserSignInLogs"
    ],
    "isItAnAttack": "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:\n\n| Pattern | Likely meaning |\n|---|---|\n| 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. |\n| Rows in the non-interactive log for a leaver | An app still holding a token for that user and retrying silently. Revoke sessions. |\n| 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) |\n| 50057 mixed with 50126 and 50034 from the same IP | The same spray hitting live, disabled and non-existent names. |\n| 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. |\n| A 50057 account that suddenly shows a **success** | The account was re-enabled. Check the audit log for who did it. |\n\nBecause 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.",
    "conditionalAccess": {
      "heading": "How do Conditional Access and MFA affect it?",
      "text": "- Conditional Access does not evaluate a 50057. The account is refused before CA runs.\n- `AuthenticationRequirement` on these rows says nothing about whether MFA is enforced in your tenant. MFA was never reached.\n- 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."
    }
  },
  "kql": [
    {
      "title": null,
      "leadIn": "One IP trying several disabled accounts in a day:",
      "query": "SigninLogs\n| where TimeGenerated > ago(1d)\n| where ResultType == \"50057\"\n| summarize DisabledUsers = dcount(UserPrincipalName),\n            Attempts = count(),\n            Users = make_set(UserPrincipalName, 20),\n            Clients = make_set(ClientAppUsed, 5)\n          by IPAddress\n| where DisabledUsers >= 3\n| sort by DisabledUsers desc"
    },
    {
      "title": null,
      "leadIn": "What is still trying to use disabled accounts, interactive and non-interactive together:",
      "query": "union SigninLogs, AADNonInteractiveUserSignInLogs\n| where TimeGenerated > ago(14d)\n| where ResultType == \"50057\"\n| summarize Attempts = count(),\n            FirstSeen = min(TimeGenerated),\n            LastSeen = max(TimeGenerated),\n            IPs = make_set(IPAddress, 10)\n          by UserPrincipalName, AppDisplayName, ClientAppUsed, IsInteractive\n| sort by LastSeen desc"
    }
  ],
  "kqlSectionText": "One IP trying several disabled accounts in a day:\n\n```kusto\nSigninLogs\n| where TimeGenerated > ago(1d)\n| where ResultType == \"50057\"\n| summarize DisabledUsers = dcount(UserPrincipalName),\n            Attempts = count(),\n            Users = make_set(UserPrincipalName, 20),\n            Clients = make_set(ClientAppUsed, 5)\n          by IPAddress\n| where DisabledUsers >= 3\n| sort by DisabledUsers desc\n```\n\nWhat is still trying to use disabled accounts, interactive and non-interactive together:\n\n```kusto\nunion SigninLogs, AADNonInteractiveUserSignInLogs\n| where TimeGenerated > ago(14d)\n| where ResultType == \"50057\"\n| summarize Attempts = count(),\n            FirstSeen = min(TimeGenerated),\n            LastSeen = max(TimeGenerated),\n            IPs = make_set(IPAddress, 10)\n          by UserPrincipalName, AppDisplayName, ClientAppUsed, IsInteractive\n| sort by LastSeen desc\n```\n\nThe threshold of 3 in the first query is a starting point. Tune it to how many leavers you normally see.",
  "fix": {
    "short": "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.",
    "steps": "**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.\n\n**For admins:**\n1. 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.\n2. If it is a leaver, find the device or app in the second query and remove the account from it.\n3. When you disable an account for offboarding or an incident, also **revoke sessions**.\n4. 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."
  },
  "labReproduced": {
    "date": "2026-10-25",
    "method": "ROPC token request against a lab tenant",
    "scenario": "Account disabled",
    "message": "AADSTS50057: The user account is disabled.",
    "logCaptured": "2026-10-30",
    "kqlTested": "2026-10-30"
  },
  "labSectionText": "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:\n\n> AADSTS50057: The user account is disabled.\n\nThat confirms the code and its wording at the token endpoint.\n\nThe same attempt in the lab tenant's sign-in log (Entra admin center, interactive user sign-ins), with identifiers left out:\n\n| Field | Value in the lab row |\n|---|---|\n| Status | Failure |\n| Sign-in error code | 50057 |\n| Failure reason | The user account is disabled. |\n| Authentication details | Password (password in the cloud), succeeded: false |\n| Authentication requirement | Single-factor authentication |\n| Conditional Access | Not Applied |\n| Client app | Mobile Apps and Desktop clients |\n| Resource | Microsoft Graph |\n| User type | Member |\n| Cross tenant access type | None |\n\nTwo 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.",
  "labRuns": [
    {
      "date": "2026-10-25",
      "run": null,
      "method": "ROPC token request against a lab tenant",
      "issue": "https://github.com/GrantZero604/Brambrinkmeier.com/issues/38",
      "scenario": "Account disabled",
      "expected": "50057",
      "got": "50057",
      "matchedExpectation": true,
      "message": "AADSTS50057: The user account is disabled."
    },
    {
      "date": "2026-10-30",
      "run": "round 4",
      "method": "token-endpoint requests against a lab tenant",
      "issue": "https://github.com/GrantZero604/Brambrinkmeier.com/issues/67",
      "scenario": "Account disabled",
      "expected": "50057",
      "got": "50057",
      "matchedExpectation": true,
      "message": "AADSTS50057: The user account is disabled."
    },
    {
      "date": "2026-10-30",
      "run": "round 5",
      "method": "token-endpoint requests against a lab tenant, using lab-created test apps",
      "issue": "https://github.com/GrantZero604/Brambrinkmeier.com/issues/69",
      "scenario": "Account disabled",
      "expected": "50057",
      "got": "50057",
      "matchedExpectation": true,
      "message": "AADSTS50057: The user account is disabled."
    },
    {
      "date": "2026-10-30",
      "run": "round 5 (first attempt)",
      "method": "token-endpoint requests against a lab tenant",
      "issue": "https://github.com/GrantZero604/Brambrinkmeier.com/issues/68",
      "scenario": "Account disabled",
      "expected": "50057",
      "got": "50057",
      "matchedExpectation": true,
      "message": "AADSTS50057: The user account is disabled."
    },
    {
      "date": "2026-10-30",
      "run": "round 6",
      "method": "token-endpoint requests against a lab tenant, using lab-created test apps",
      "issue": "https://github.com/GrantZero604/Brambrinkmeier.com/issues/70",
      "scenario": "Account disabled",
      "expected": "50057",
      "got": "50057",
      "matchedExpectation": true,
      "message": "AADSTS50057: The user account is disabled."
    },
    {
      "date": "2026-10-30",
      "run": "round 7",
      "method": "token-endpoint requests against a lab tenant",
      "issue": "https://github.com/GrantZero604/Brambrinkmeier.com/issues/71",
      "scenario": "Account disabled",
      "expected": "50057",
      "got": "50057",
      "matchedExpectation": true,
      "message": "AADSTS50057: The user account is disabled."
    },
    {
      "date": "2026-10-30",
      "run": null,
      "method": "ROPC and other token-endpoint requests against a lab tenant",
      "issue": "https://github.com/GrantZero604/Brambrinkmeier.com/issues/66",
      "scenario": "Account disabled",
      "expected": "50057",
      "got": "50057",
      "matchedExpectation": true,
      "message": "AADSTS50057: The user account is disabled."
    },
    {
      "date": "2026-10-31",
      "run": "round 8",
      "method": "token-endpoint and device-code requests against a lab tenant",
      "issue": "https://github.com/GrantZero604/Brambrinkmeier.com/issues/72",
      "scenario": "Account disabled",
      "expected": "50057",
      "got": "50057",
      "matchedExpectation": true,
      "message": "AADSTS50057: The user account is disabled."
    },
    {
      "date": "2026-10-31",
      "run": "round 9",
      "method": "token-endpoint and device-code requests against a lab tenant",
      "issue": "https://github.com/GrantZero604/Brambrinkmeier.com/issues/73",
      "scenario": "Account disabled",
      "expected": "50057",
      "got": "50057",
      "matchedExpectation": true,
      "message": "AADSTS50057: The user account is disabled."
    }
  ],
  "verification": "lab-reproduced",
  "related": [
    "50126",
    "50053",
    "50034",
    "50055",
    "53003",
    "50173",
    "135011",
    "500341",
    "500571"
  ],
  "coveredBy": [
    {
      "title": "After a compromise: revoke Entra ID sessions and prove it worked",
      "url": "https://brambrinkmeier.com/guides/revoke-sessions-and-verify-entra-id/"
    },
    {
      "title": "How to detect password spraying in Microsoft Entra ID (with KQL)",
      "url": "https://brambrinkmeier.com/guides/detect-password-spray-entra-id/"
    }
  ],
  "sources": [
    {
      "title": "Access tokens in the Microsoft identity platform",
      "url": "https://learn.microsoft.com/en-us/entra/identity-platform/access-tokens"
    },
    {
      "title": "Microsoft Entra authentication and authorization error codes",
      "url": "https://learn.microsoft.com/en-us/entra/identity-platform/reference-error-codes"
    },
    {
      "title": "Password spray investigation (Microsoft incident response playbook)",
      "url": "https://learn.microsoft.com/en-us/security/operations/incident-response-playbook-password-spray"
    },
    {
      "title": "Revoke user access in Microsoft Entra ID",
      "url": "https://learn.microsoft.com/en-us/entra/identity/users/users-revoke-access"
    },
    {
      "title": "Non-interactive user sign-ins",
      "url": "https://learn.microsoft.com/en-us/entra/identity/monitoring-health/concept-noninteractive-sign-ins"
    },
    {
      "title": "SigninLogs table reference (Azure Monitor)",
      "url": "https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/signinlogs"
    }
  ],
  "published": null,
  "lastUpdated": "2026-11-01",
  "lastVerified": null,
  "license": "CC BY 4.0",
  "licenseUrl": "https://creativecommons.org/licenses/by/4.0/",
  "licenseNote": "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.",
  "attribution": "Bram Brinkmeier, \"AADSTS50057 fix: the user account is disabled\", https://brambrinkmeier.com/entra/aadsts/50057/ (CC BY 4.0)",
  "microsoftErrorLookup": "https://login.microsoftonline.com/error?code=50057"
}
