Australian cloud for business software — built and run in Sydney since 2002

NetLeverage
NetLeverage

AADSTS50057: "The user account is disabled" when signing in to a Microsoft Entra application

Technical article
Troubleshooting

About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.

A user tries to sign in to an application that uses Microsoft Entra ID and gets error AADSTS50057, "The user account is disabled." The code is not a password problem and not a licence problem. The account object itself is switched off. Before anyone turns it back on, decide whether it was meant to be off, because Microsoft's revocation steps for a departed or compromised user also begin with disabling the account.

Nothing before the Fix section changes anything.

What the error means

Microsoft's page for this error gives the symptom as users who sign in to an application integrated into Microsoft Entra ID receiving an "AADSTS50057" error message ("The user account is disabled."). The cause on the page is one line: "The user object is disabled on the resource tenant."

Microsoft's list of Microsoft Entra authentication and authorization error codes carries the same code with the name UserDisabled and adds: "The user object in Active Directory backing this account has been disabled. An admin can re-enable this account through PowerShell". That wording points at the directory that backs the account, which matters for accounts that come from an on-premises directory.

The page refers to the resource tenant. That is the tenant that owns the application being signed in to. When a user signs in as a guest to another organisation's tenant, the account that is disabled is the user object there, so the people who can change it are that tenant's owners, not your own administrators.

Likely causes

Situation What you see What it means
The account was disabled on purpose A leaver, a suspended account, or a response to a compromise Access is expectedly blocked; no change is wanted
The account was disabled by mistake A current employee, no ticket for disabling The resource tenant owners should re-enable it
The account is a guest in another tenant The error appears only for that organisation's application The disabled object sits in the other tenant
The account is synchronised from on-premises Active Directory The error text names Active Directory The disabled state may originate on-premises

Microsoft's page gives no counts for these situations, so the rows are not in order of likelihood. The last row follows from the error list's wording, not from a statement on the error page.

Prove the cause before changing anything

All of these only read.

  1. Copy the full error text and the time it appeared. The error page for any code can be looked up at https://login.microsoftonline.com/error, which Microsoft's page gives for investigating individual errors.
  2. Work out which tenant owns the application. If the application belongs to your tenant, the resource tenant is yours. If it belongs to a supplier or customer, the resource tenant is theirs.
  3. In the Microsoft Entra admin center of the resource tenant, browse to Entra ID > Users > All users and select the user. Microsoft's page for revoking user access describes the Account status area with an Edit option, where the Account enabled box shows whether the account is switched on. Read the state without changing it.
  4. Find out why the account is disabled. Ask whoever manages joiners and leavers whether the person has left, whether the account was suspended, and whether a ticket exists. Microsoft's page says to engage the resource tenant owners to determine why the account is disabled.

Example (illustrative): at contoso.com.au a bookkeeper called Mia cannot sign in to a supplier's portal that uses Microsoft Entra sign-in. The error is AADSTS50057. The portal belongs to the supplier's tenant, where Mia has a guest account. The supplier's administrator finds the account disabled after a bulk clean-up of old guests and confirms Mia is still contracted. That is the "disabled by mistake" row.

Fix

Microsoft's page gives a two-row decision. If the account is supposed to be disabled, take no action, because access is expectedly blocked. If it is not supposed to be disabled, or it was disabled by mistake, the resource tenant owners should re-enable it.

For the second case, the page names one of the options: setting the -AccountEnabled parameter to $true with the Set-AzureADUser cmdlet. Microsoft's page on revoking user access states that the Azure AD and MSOnline PowerShell modules are deprecated and recommends moving to Microsoft Graph PowerShell. The steps below therefore lead with the admin centre and show the Graph cmdlet Microsoft uses for the opposite change as an example.

Before you re-enable the account, write down the user's name, the tenant, the time of the error, the reason the account was disabled and who disabled it. Take a screenshot of the Account status area so the disabled state is on record.

Risk: The next steps switch a disabled user account back on. If the account was disabled because someone left or because it was compromised, re-enabling it gives that person or whoever holds the credentials sign-in to every application the account can reach. Confirm the reason you wrote down before you save the change.

  1. Sign in to the Microsoft Entra admin center of the resource tenant with an account that has the right role. Microsoft's revocation page names User Administrator for non-admin users and Privileged Authentication Administrator for admin accounts for disabling an account; confirm the role needed to re-enable in your own tenant.
  2. Browse to Entra ID > Users > All users, and select the user.
  3. Under Account status, select Edit.
  4. In Properties, select Account enabled, then select Save. Microsoft's revocation page gives these steps in the disabling direction (clear Account enabled). Its page on creating users says that Account enabled is checked by default, that unchecking it prevents sign-in, and that "You can change this setting after the user is created." Check the box state on screen before you save.

If you work in PowerShell, Microsoft's page for revoking access shows Update-MgUser -UserId $User.Id -AccountEnabled:$false to disable the user. The Update-MgUser reference describes the AccountEnabled value as "true if the account is enabled; otherwise, false", so -AccountEnabled:$true is the matching example for enabling. That is an example that follows the page's pattern, not a command Microsoft's AADSTS50057 page shows.

To undo it: disable the account again. In the admin centre, open the user, select Edit under Account status, clear Account enabled and select Save, then select Revoke sessions on the user's Overview page. In PowerShell, Microsoft shows Update-MgUser -UserId $User.Id -AccountEnabled:$false followed by Revoke-MgUserSignInSession -UserId $User.Id after you set $User with Get-MgUser.

For an account synchronised from on-premises Active Directory, the revocation page's hybrid steps disable the user in Active Directory first. Microsoft's pages do not give a re-enabling procedure for that case, so treat the on-premises account as the source and change it with your normal Active Directory process.

Confirm the fix

  • The user can sign in to the application and reaches it with no AADSTS50057.
  • In the Microsoft Entra admin centre the user's Account enabled box is selected.
  • The person who owns the decision to disable and re-enable the account has the reason recorded.

What to watch afterwards

  • Whether the account is disabled again by a leaver process or a clean-up. Find out which, or the error returns.
  • Other guests disabled in the same clean-up, which will hit the same error one at a time.
  • Sign-in attempts by an account that should stay disabled. Microsoft's revocation page treats disabling as part of removing access, so repeated attempts on a leaver's account deserve a look.
  • Whether a Microsoft Entra Connect or other synchronisation process re-applies a disabled state from on-premises.
  • The gap between the disabling and the first error. Microsoft's revocation page says that after an account is disabled the user can't gain new tokens for any application tied to Microsoft Entra ID, that applications using access tokens lose access when the access token expires, and that applications using session tokens end existing sessions as soon as the token expires. A user can therefore keep working for a while and then meet AADSTS50057 at the next sign-in.

Risks and limits

These steps have not been run or lab-tested.

The error page covers applications integrated with Microsoft Entra ID and gives no version range. It names Set-AzureADUser, a cmdlet from a module that Microsoft's revocation page says is deprecated. The Graph example above is an example of the same change in the supported module, not Microsoft's text for this error. Microsoft's pages do not state which role may re-enable an account, so use the role your tenant gives for editing users. Microsoft's error list says an admin can re-enable the account through PowerShell, and the error page says the resource tenant owners decide, so a customer in another organisation's tenant cannot re-enable it themselves.

Sources