1. Resources
  2. Detection rules
  3. Sign-In Attempt to a Disabled Account

Sign-In Attempt to a Disabled Account detection rules

Someone tries to sign in to an account that has been disabled, for example the account of a person who left. The attempt is refused with error 50057, and it shows that the account is still being targeted.

Platform
Microsoft Entra ID
Severity
Low
Log source
Microsoft Entra ID sign-in logs
Last updated
Rule formats
Sigmaand queries for: SplunkMicrosoft Sentinel
What an attacker needs
The user name of a disabled account and usually a password, token or device that used to belong to it, plus a sign-in endpoint of the tenant.
Impact
No access while the account stays disabled, but a sign that its credentials may be known and will work again if the account is ever enabled.
Response
Confirm that the account is still disabled, then reset its password, revoke its sessions and remove its authentication methods and roles.
Mitigation
When you disable an account, also reset its password, revoke its sessions and remove its authentication methods, roles and group memberships.

How the attack works

Accounts are disabled when people leave, when a contractor's engagement ends, or when responders contain an account they believe is compromised. The account stays in the directory with its password, its group memberships and its roles, and Microsoft Entra ID refuses its sign-ins with error 50057, UserDisabled. An attempt to use such an account is therefore harmless at the moment it happens. It is still worth knowing about, because nobody with a legitimate reason signs in to a disabled account.

The attempt can come from a former employee who tries the old account, from a device or script that was never cleaned up, or from an attacker who works through a list of user names and credentials collected earlier. Microsoft's security operations guides list the event for user accounts and for privileged accounts and say that it could indicate someone is trying to gain access to an account after its owner has left the organization, and that it is important to log and alert on it although the account is blocked. Microsoft does not document whether the error is returned only after the right password was presented, so one event does not prove that the password is known.

The single-event rule on this page reads error 50057 from the sign-in log. A second rule counts the disabled accounts one IP address tried within an hour, which separates a list being worked through from one person's old phone. The real risk lies in the next step: a disabled account that someone enables again becomes usable with the same credentials.

What an attacker needs

  • The user name of a disabled account, and usually a password, token or device that used to belong to it.
  • A sign-in endpoint of the tenant, which is reachable from the internet.

Impact

None while the account stays disabled: the sign-in is refused. The attempt shows that the account's name, and possibly its credentials, are in someone's hands. If the account is enabled again, by mistake, by a provisioning system or by an attacker with the right to manage users, the old credentials work again together with every role and membership the account still has.

Detection rules

One IP Address Tried to Sign In to Several Disabled Accounts

Counts, per source IP address, the distinct users whose sign-in was refused with error 50057 (UserDisabled). A device that was never cleaned up retries one account. An address that tries three or more different disabled accounts within one hour is working through a list of user names, for example an old export of the directory or credentials collected in an earlier breach. The threshold and the window are starting points to tune against your own baseline. The rule reads the interactive sign-in log, so run the same count over the non-interactive user sign-in log (AADNonInteractiveUserSignInLogs in Sentinel) as well.

Fires when one IPAddress has at least 3 different UserPrincipalName values within 1 hour.

Threshold ruleLevelMediumStatusExperimentalLog sourceMicrosoft Entra ID sign-in logs
title: Sign-In Refused Because the Account Is Disabled (Several Accounts Base Event)
id: c333f09e-4abb-48c0-9714-eba847e904a6
name: entra_sign_in_to_disabled_account
status: experimental
description: >-
  Base event of the threshold rule in this file. A Microsoft Entra sign-in
  that was refused with error 50057 (UserDisabled, the user account is
  disabled).
logsource:
  product: azure
  service: signinlogs
detection:
  selection:
    ResultType: '50057'  # string column: UserDisabled
  condition: selection
level: low
---
title: One IP Address Tried to Sign In to Several Disabled Accounts
id: 3d4440d8-2cf8-4d4d-9473-40e8a8672da0
status: experimental
description: >-
  Counts, per source IP address, the distinct users whose sign-in was refused
  with error 50057 (UserDisabled). A device that was never cleaned up retries
  one account. An address that tries three or more different disabled
  accounts within one hour is working through a list of user names, for
  example an old export of the directory or credentials collected in an
  earlier breach. The threshold and the window are starting points to tune
  against your own baseline. The rule reads the interactive sign-in log, so
  run the same count over the non-interactive user sign-in log
  (AADNonInteractiveUserSignInLogs in Sentinel) as well.
references:
  - https://learn.microsoft.com/en-us/entra/identity-platform/reference-error-codes
  - https://learn.microsoft.com/en-us/entra/architecture/security-operations-user-accounts
  - https://attack.mitre.org/techniques/T1078/004/
author: Forestall
date: 2026-11-18
tags:
  - attack.initial-access
  - attack.persistence
  - attack.t1078.004
correlation:
  type: value_count
  rules:
    - entra_sign_in_to_disabled_account
  group-by:
    - IPAddress
  timespan: 1h
  condition:
    field: UserPrincipalName
    gte: 3
falsepositives:
  - Addresses that many employees share, such as office egress points, VPN exits and virtual desktop pools, right after a group of accounts was disabled, for example at the end of a project or a seasonal contract.
  - A shared kiosk or meeting room device that holds the sessions of several people who have left.
  - The values of three accounts and one hour are starting points, not tested limits.
level: medium

False positives

  • Addresses that many employees share, such as office egress points, VPN exits and virtual desktop pools, right after a group of accounts was disabled, for example at the end of a project or a seasonal contract.
  • A shared kiosk or meeting room device that holds the sessions of several people who have left.
  • The values of three accounts and one hour are starting points, not tested limits.

Sign-In Attempt to a Disabled Account

Detects a sign-in that Microsoft Entra ID refused with error 50057 (UserDisabled, the user account is disabled). Microsoft's security operations guides for user accounts and for privileged accounts list this event with a low risk level and say that it could indicate someone is trying to gain access to an account after its owner has left the organization, and that it is important to log and alert on it although the account is blocked. Microsoft does not document whether the error is returned only after the correct password was presented. The rule reads the interactive sign-in log, so run the same search over the non-interactive user sign-in log (AADNonInteractiveUserSignInLogs in Sentinel) as well, where devices and applications that still hold a token of the account appear.

LevelLowStatusExperimentalLog sourceMicrosoft Entra ID sign-in logs
title: Sign-In Attempt to a Disabled Account
id: 205b2020-3e62-4e03-934e-6179a42c19c1
status: experimental
description: >-
  Detects a sign-in that Microsoft Entra ID refused with error 50057
  (UserDisabled, the user account is disabled). Microsoft's security
  operations guides for user accounts and for privileged accounts list this
  event with a low risk level and say that it could indicate someone is trying
  to gain access to an account after its owner has left the organization, and
  that it is important to log and alert on it although the account is blocked.
  Microsoft does not document whether the error is returned only after the
  correct password was presented. The rule reads the interactive sign-in log,
  so run the same search over the non-interactive user sign-in log
  (AADNonInteractiveUserSignInLogs in Sentinel) as well, where devices and
  applications that still hold a token of the account appear.
references:
  - https://learn.microsoft.com/en-us/entra/identity-platform/reference-error-codes
  - https://learn.microsoft.com/en-us/entra/architecture/security-operations-user-accounts
  - https://learn.microsoft.com/en-us/entra/architecture/security-operations-privileged-accounts
  - https://attack.mitre.org/techniques/T1078/004/
author: Forestall
date: 2026-11-18
tags:
  - attack.initial-access
  - attack.persistence
  - attack.t1078.004
logsource:
  product: azure
  service: signinlogs
detection:
  selection:
    ResultType: '50057'  # string column: UserDisabled
  condition: selection
falsepositives:
  - Phones, mail clients and scripts that still hold the credentials of an account that was disabled and keep retrying, usually from an address the account used before.
  - A person whose account was disabled by mistake or who returns from leave before the account was enabled.
  - Raise the priority for a new source address, for a privileged account and for an account that was disabled during an incident.
level: low

False positives

  • Phones, mail clients and scripts that still hold the credentials of an account that was disabled and keep retrying, usually from an address the account used before.
  • A person whose account was disabled by mistake or who returns from leave before the account was enabled.
  • Raise the priority for a new source address, for a privileged account and for an account that was disabled during an incident.

Detection logic

Patterns that need more than one event, a baseline or knowledge of your own environment. Each is a hypothesis to build and tune in your SIEM, not a ready rule.

Attempts on a disabled account, then the account is enabled and signs in

Detection hypothesisSequence of eventsJoins two logs

Refused attempts show interest in a disabled account. If the same account is then enabled and signs in successfully, someone with the right to manage users has turned a blocked account into a working one. When the successful sign-in comes from the address of the earlier attempts, the person who tried and the person who benefits are the same.

  1. Sign-in log: one or more sign-ins with ResultType 50057 for an account. Keep the UserPrincipalName and the IPAddress.
  2. Audit log, within 7 days: activity Enable account with that account in TargetResources. Note the actor in InitiatedBy.
  3. Sign-in log, after the enabling: a sign-in with ResultType 0 for the same UserPrincipalName.
  4. Raise the priority when the IPAddress of the successful sign-in equals the address of the refused attempts.

Events50057Enable account

LimitsA returning employee whose account is enabled on request produces the same three steps, including attempts from their own device before the account was ready. Confirm the request behind the enabling. The 7 days are a starting point.

Address that tries disabled accounts also fails for active accounts

Detection hypothesisJoins two logs

A forgotten device only ever tries its own account. An address that gets error 50057 for a disabled account and wrong-password errors for active accounts in the same period is working through a list of user names, and the disabled account is simply an old entry on that list.

  1. Sign-in log: collect the values of IPAddress that produced ResultType 50057 in the last 24 hours.
  2. For each address, count the distinct UserPrincipalName values with ResultType 50126 or 50053 in the same 24 hours.
  3. Alert when an address has failures for several other accounts, and check whether any sign-in from it succeeded (ResultType 0).

Events500575012650053

LimitsOffice egress addresses, VPN exits and virtual desktop pools carry the mistakes of many users and the forgotten device of a former colleague at the same time. Exclude your trusted locations or give them a higher count. The 24 hours are a starting point.

Triage

  • Identify the account (UserPrincipalName), when and why it was disabled, and whether it still holds roles or group memberships.
  • Read the source of the attempt (IPAddress, location, client application and device details) and compare it with the last legitimate sign-ins of the account.
  • Search the sign-in log for the same IP address. Attempts on other accounts, disabled or active, point to a list being worked through.
  • Check the audit log for an Enable account event for the same account after the attempt.
  • If the account was disabled during an incident, treat the attempt as the attacker testing whether containment holds.

Response

Once the attack is confirmed:

  1. Confirm that the account is still disabled and that no Enable account event followed the attempts.
  2. Reset the password of the account, revoke its sessions and remove its authentication methods, in case the credentials are known.
  3. Remove the roles and group memberships the account still holds.
  4. If the same address tried other accounts, check each of them for a successful sign-in and handle those accounts as compromised.
  5. Find out where the credentials came from. If the account belonged to a person who left, check what else that person could still reach, such as shared accounts and application passwords.

Mitigation

  • When you disable an account, also reset its password, revoke its sessions and remove its authentication methods, so that enabling it again does not bring old credentials back to life.
  • Remove roles and group memberships from disabled accounts, and delete the accounts once the retention period you need has passed.
  • Clean up the devices, scripts and service connections of people who leave, so that the remaining attempts on a disabled account are the ones that matter.
  • Alert when a disabled account is enabled again, and require a request for it.

Frequently asked questions

The sign-in was refused, so why should anyone look at it?

Because nobody has a legitimate reason to sign in to a disabled account. Microsoft's security operations guides list the event and say that it could indicate someone trying to gain access to an account after its owner has left, and that it is important to log and alert on it although the account is blocked.

Does error 50057 mean the attacker knows the password?

Not necessarily. Microsoft documents the code as UserDisabled, the user account is disabled, and does not say whether it is returned only after the correct password was presented. Treat the credentials of the account as possibly known and reset them, but do not conclude it from the event alone.

What usually causes these events without any attacker?

Devices, mail clients and scripts that still hold the credentials or tokens of an account that was disabled. They retry on their own, often at regular intervals and from an address the account used before. A new address, several disabled accounts from one address, or attempts on an account disabled during an incident do not fit that picture.

Why does the threshold rule count accounts and not attempts?

One forgotten device can produce hundreds of attempts for a single account. Several different disabled accounts tried from one IP address within an hour is a different pattern: someone is working through a list of user names. The rule starts at three accounts within one hour, and both values are starting points.

References

We respect your privacy

We use cookies to keep this site secure and working properly. With your permission, we also use optional cookies to understand usage and improve the experience. Cookie Policy

You can change your choice at any time.