Before you run
Data & scope
- Required tables
- Time window
- 24 hours; 15-minute groups
- Microsoft Entra ID connector with interactive SigninLogs ingested into this workspace.
- Microsoft Entra ID P1 or P2 for sign-in-log ingestion; query access to SigninLogs.
Documentation review by Codex (AI). No live-tenant execution or detection-performance claim. Validate schema, data coverage and expected results in your workspace.
// Hunting starter. Documentation checked 2026-11-13; not tenant-tested.
let lookback = 1d;
let minimumFailures = 5;
SigninLogs
| where TimeGenerated >= ago(lookback) and TimeGenerated <= now()
| where IsInteractive == true
| where isnotempty(ResultType) and ResultType != "0"
| summarize FailureRecords = count(), FirstSeen = min(TimeGenerated),
LastSeen = max(TimeGenerated), Apps = make_set(AppDisplayName, 10),
ErrorCodes = make_set(ResultType, 10)
by AADTenantId, UserId, UserPrincipalName, IPAddress,
WindowStart = bin(TimeGenerated, 15m)
| where FailureRecords >= minimumFailures
| order by FailureRecords desc, LastSeen desc
| take 200
Read-only query. Run in your own authorized workspace after checking prerequisites.
Use this hunt to find concentrated interactive sign-in problems before deciding whether they represent password guessing, an application issue or ordinary user friction. It returns identity/IP groups with at least five failure records in a fixed 15-minute bucket during the last day. It creates no rule, incident or account action.
Read the result
The filter explicitly selects interactive events. In this table, ResultType is a string containing the sign-in error code, and 0 denotes success. A nonzero result is not synonymous with an incorrect password: read the original error description before classifying it. Schema and result semantics.
FailureRecords counts matching ingested rows. Each row of the result retains the directory tenant, user identifiers, source IP, first and last observation, and small sets of applications and codes. The ten-value sets are examples, not exhaustive evidence. WindowStart uses fixed UTC boundaries; attempts straddling two buckets are split. The 200-row ceiling prioritizes volume and recent activity rather than providing a full export.
Triage and tune
Start with the highest-volume unfamiliar groups. Retrieve the original events for that user, IP and interval, preserving correlation or event IDs. Compare the error codes, target application, Conditional Access outcome and nearby successful sign-ins. Confirm expected device, VPN and application behavior with the identity owner through an established channel.
Common benign causes include forgotten passwords, repeated MFA interaction, stale clients and a changed access policy. A shared egress address can represent many users. Tune minimumFailures and the bucket size against your normal patterns; record narrow exceptions with owners and expiry dates instead of excluding whole corporate networks indefinitely.
Limits and validation
This grouping can miss low-and-slow or distributed activity and does not cover noninteractive users, service principals or managed identities. Unknown or empty user identifiers need separate attribution. Check connector freshness and the portal time range before interpreting no rows as reassuring. The query was checked against Microsoft documentation only; it has not been run against a tenant or validated as a detection. Validate known test failures and ordinary traffic before operational use.
Verify the source
Microsoft references
Measure normal activity, validate known test cases, account for ingestion delays, choose a threshold and entity mapping, and assign an owner. Results require investigation.
Follow the detection learning path →