Before you run
Data & scope
- Required tables
- Time window
- 24 hours
- Microsoft Entra ID connector with SigninLogs available and policy evaluation details populated.
- Microsoft Entra ID P1 or P2 for ingestion, suitable access to policy evidence and query permissions.
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.
SigninLogs
| where TimeGenerated >= ago(1d) and TimeGenerated <= now()
| where IsInteractive == true
| mv-expand Policy = ConditionalAccessPolicies
| extend PolicyId = tostring(Policy.id), PolicyName = tostring(Policy.displayName),
PolicyResult = tostring(Policy.result)
| where PolicyResult =~ "failure"
| summarize EvaluationRows = count(), Users = dcount(UserId),
FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated),
ResultCodes = make_set(ResultType, 10),
SignInSamples = make_set(Id, 10), SourceIPs = make_set(IPAddress, 10)
by AADTenantId, PolicyId, PolicyName, AppId, AppDisplayName,
ConditionalAccessStatus, PolicyResult
| order by EvaluationRows desc
| take 200
Read-only query. Run in your own authorized workspace after checking prerequisites.
Use this breakdown when a policy rollout causes access issues or when you need to understand repeated policy failures around a protected application. The query reads interactive sign-ins, expands their Conditional Access policy evaluations and selects the explicit failure result. It does not classify a policy as incorrect or identify a compromised user.
Understand the unit of evidence
One sign-in can contain several policy evaluations. EvaluationRows therefore counts expanded rows, not unique authentication attempts. Users is an approximate distinct count, and the bounded sign-in ID sample lets you reopen representative records. Grouping by stable policy ID avoids merging unrelated policies with similar names.
The applied-policy resource distinguishes ordinary failure from report-only outcomes and other evaluation states. This query deliberately excludes report-only failure; add a separately labelled analysis if the rollout is still being evaluated. A policy array that is missing or empty produces no expanded row and is outside the result. Policy result contract.
Diagnose the control path
Inspect representative original sign-ins, the full policy conditions, grant requirements and session controls. Check whether the affected users and resources were intended targets. Compare device state, client category and authentication requirements with the rollout design. Microsoft provides a Conditional Access troubleshooting workflow for resolving individual evaluations.
Legitimate unmanaged devices, stale sessions, policy changes, emergency-access tests and an unavailable authentication method can all cause failures. Conversely, a correctly blocked hostile request is a successful security outcome. Avoid changing a broad policy merely to reduce the number of rows in this report.
Record the policy version or export used during the investigation. A present-day policy view can differ from the configuration evaluated at the event time. Keep user identifiers and network evidence within the investigation’s access boundary.
Validate the scope
Test a known enforced block, a report-only failure, a successful policy and an event without policy details. Confirm that the intended cases appear and that the report-only event is excluded. Review the aggregate sign-in status beside each policy outcome rather than treating either as the entire authentication story.
This documentation-checked hunt has not been executed in a tenant. It covers only the selected interactive table and one day of available telemetry. Missing collection, restricted evidence visibility and the 200-group display cap can reduce what you see; empty output does not demonstrate policy effectiveness.
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 →