Investigate Risky Users in Entra ID Protection: A Step-by-Step Guide
Summary
Microsoft Entra ID Protection rates every sign-in and every user for the probability of compromise and lists the results in its risky users, risky sign-ins and risk detections reports. To investigate a risky user, export the open risk, read the detections and sign-ins, then remediate, confirm or dismiss, and let risk-based Conditional Access handle the next case.
Quick steps
- Check licenses and roles: full detail needs Microsoft Entra ID P2.
- Export risky users and recent risk detections with the read-only script.
- Investigate each user's detections, sign-ins and risk history.
- Remediate a compromised account: block if needed, reset the password, revoke sessions, confirm compromised.
- Dismiss or confirm safe only what you've shown to be benign.
- Turn on user risk and sign-in risk policies in Conditional Access, and migrate any legacy ID Protection policy.
- Review risky workload identities.
- Export risk data to Log Analytics and alert on open risk and on risk actions.
Applies to: Microsoft Entra ID Protection, as of November 2026. Full reports, risk-based policies and the Microsoft Graph riskyUsers API need Microsoft Entra ID P2 or Microsoft Entra Suite; Free and P1 tenants see limited reports. Full workload identity risk details need Workload Identities Premium. The scripts use the Microsoft Graph PowerShell v1.0 cmdlets and run in Windows PowerShell 5.1.
What is Microsoft Entra ID Protection, and what makes a user risky?
Microsoft Entra ID Protection is the Microsoft Entra service that detects, investigates and remediates identity-based risk, and feeds that risk to Conditional Access and to SIEM tools. It works with two kinds of risk. Sign-in risk is the probability that a sign-in wasn't authorized by the account's owner, and user risk is the probability that the identity itself is compromised. A risky user is a user with one or more risky sign-ins, or with risk detected on the account itself, such as leaked credentials.
Signing in to a cloud account with stolen credentials is MITRE ATT&CK T1078.004, Valid Accounts: Cloud Accounts. Password spraying, adversary-in-the-middle phishing and other credential theft techniques end with credentials or tokens that Microsoft Entra ID accepts, so the detections look for what gives the attacker away: an unfamiliar sign-in, a malicious IP address, an unusual token or a breached password.
Sign-in risk vs user risk
| Sign-in risk | User risk | |
|---|---|---|
| What it measures | The probability that the authentication request isn't authorized by the identity owner | The probability that the identity is compromised |
| How it's calculated | Real-time detections during the sign-in, plus offline detections afterward | All active risk detections on the user, including sign-in risk that wasn't remediated |
| How users self-remediate | Complete the MFA that a sign-in risk policy requires | Complete the secure password change, or for passwordless users the reauthentication, that a user risk policy requires |
| Conditional Access condition | Sign-in risk | User risk |
Risk comes in three levels: low, medium and high. Microsoft's risk level guidance says low-risk detections and users age out after six months, while medium and high risk persist until remediated or dismissed. Leaked credentials and Verified threat actor IP always arrive as high risk. Real-time detections take 5 to 10 minutes to reach the reports, and offline detections up to 48 hours, so a user's risk level can change well after the sign-in.
Which risk detections does ID Protection report?
Microsoft's list of risk detections marks each one Premium, which needs at least Microsoft Entra ID P2, or Nonpremium, which is available with Microsoft Entra ID Free. The riskEventType column holds the value that appears in Microsoft Graph queries; for the detections this guide returns to, the value links to Forestall's page about it. These are the sign-in risk detections:
| Sign-in risk detection | Timing | Type | riskEventType |
|---|---|---|---|
| Activity from anonymous IP address | Offline | Premium | riskyIPAddress |
| Suspicious MFA authentication approval | Real-time | Premium | authenticatorPhishing |
| Additional risk detected (sign-in) | Real-time or offline | Nonpremium | generic |
| Admin confirmed user compromised | Offline | Nonpremium | adminConfirmedUserCompromised |
| Anomalous Token (sign-in) | Real-time or offline | Premium | anomalousToken |
| Anonymous IP address | Real-time | Nonpremium | anonymizedIPAddress |
| Atypical travel | Real-time | Premium | unlikelyTravel |
| Impossible travel | Offline | Premium | mcasImpossibleTravel |
| Malicious IP address | Offline | Premium | maliciousIPAddress |
| Mass Access to Sensitive Files | Offline | Premium | mcasFinSuspiciousFileAccess |
| Microsoft Entra threat intelligence (sign-in) | Real-time or offline | Nonpremium | investigationsThreatIntelligence |
| New country | Offline | Premium | newCountry |
| Password spray | Real-time or offline | Premium | passwordSpray |
| Suspicious browser | Offline | Premium | suspiciousBrowser |
| Suspicious inbox forwarding | Offline | Premium | suspiciousInboxForwarding |
| Suspicious inbox manipulation rules | Offline | Premium | mcasSuspiciousInboxManipulationRules |
| Token issuer anomaly | Offline | Premium | tokenIssuerAnomaly |
| Unfamiliar sign-in properties | Real-time | Premium | unfamiliarFeatures |
| Verified threat actor IP | Real-time | Premium | nationStateIP |
And these are the user risk detections:
| User risk detection | Timing | Type | riskEventType |
|---|---|---|---|
| Additional risk detected (user) | Real-time or offline | Nonpremium | generic |
| Anomalous Token (user) | Real-time or offline | Premium | anomalousToken |
| Anomalous user activity | Offline | Premium | anomalousUserActivity |
| Attacker in the Middle | Offline | Premium | attackerinTheMiddle |
| Leaked credentials | Offline | Nonpremium | leakedCredentials |
| Microsoft Entra threat intelligence (user) | Real-time or offline | Nonpremium | investigationsThreatIntelligence |
| Possible attempt to access Primary Refresh Token (PRT) | Offline | Premium | attemptedPrtAccess |
| Suspicious API Traffic | Offline | Premium | suspiciousAPITraffic |
| Suspicious credential addition | Real-time | Premium | suspiciousCredentialAddition |
| Suspicious sending patterns | Offline | Premium | suspiciousSendingPatterns |
| User reported suspicious activity | Offline | Premium | userReportedSuspiciousActivity |
Three details change how you read these tables:
- Without P2, premium detections still fire, but they appear as Additional risk detected with the riskEventType
generic. - Microsoft Defender signals: detections that come from Microsoft Defender for Cloud Apps, Defender for Office 365 or Defender for Endpoint also need a license for that product. The detection list gives the combination for each one.
- API values differ: Microsoft's v1.0
riskDetectionreference lists a shorter set of values, withoutattackerinTheMiddleornationStateIPfor example, and namesimpossibleTravelwhere the detection list saysmcasImpossibleTravel. The script and queries in this guide use the detection list's values.
What licenses does Entra ID Protection need?
As of November 2026, the Microsoft Entra licensing page says ID Protection requires Microsoft Entra ID P2, and gives Free and P1 tenants a reduced view:
| Capability | Free / Microsoft 365 Apps | P1 | P2, Microsoft Entra Suite or Microsoft 365 E7 |
|---|---|---|---|
| Sign-in and user risk policies (Conditional Access) | No | No | Yes |
| Risky users report | Only users at medium and high risk; no details drawer or risk history | Same as Free | Full access |
| Risky sign-ins report | No risk detail or risk level | Same as Free | Full access |
| Risk detections report | No | No details drawer | Full access |
| Users at risk detected alerts and weekly digest | No | No | Yes |
| MFA registration policy | No | No | Yes |
The Microsoft Graph reference adds that the riskyUsers API requires Microsoft Entra ID P2. For workload identities, full risk details and risk-based access controls need Workload Identities Premium; tenants without it still receive every detection, with limited details.
Before you start
Plan who investigates, who remediates and how users will fix their own risk before you turn anything on. Test the risk policies in a lab tenant first, because a user risk policy can block every user who can't complete the remediation it asks for.
Roles you need
| Task | Least privileged role in Microsoft's articles |
|---|---|
| View the ID Protection reports | Security Reader; Global Reader also has read-only access |
| View sign-in and audit logs | Reports Reader |
| Dismiss user risk, confirm safe, confirm compromised in the admin center | Security Operator |
| The same actions through Microsoft Graph | Security Administrator |
| Reset a password from the user's details | User Administrator |
| Generate a temporary password from ID Protection | Security Operator and User Administrator |
| Create risk-based Conditional Access policies | Conditional Access Administrator |
| Configure notifications, the MFA registration policy and diagnostic settings | Security Administrator |
| Allow on-premises password change to reset user risk | Security Operator |
Microsoft's pages disagree on dismissal: the remediation article names Security Operator as the least privileged role, the Graph reference names Security Administrator.
Prepare self-remediation and logging
Self-remediation only works if users can complete the control the policy asks for:
- MFA registration comes first. Users must register for MFA before they face a remediation; unregistered users are blocked and need an administrator. Microsoft's notes on its managed policies add that it blocks risky users from registering for MFA, so registration can't wait until the risk appears. The MFA registration policy under ID Protection > Dashboard prompts users at their next interactive sign-in and gives them 14 days.
- Hybrid users need password writeback. For users synchronized from on-premises Active Directory, password writeback must be enabled, through Microsoft Entra Connect or Cloud Sync; our Entra Connect and Cloud Sync hardening guide covers both. A cloud password reset clears a leaked credentials detection for on-premises passwords only when password hash synchronization is on.
- Export the logs early. Log Analytics sees risk data only from the moment you start sending it (Step 6).
- Exclude emergency access accounts from every risk policy, as our break glass account guide describes.
Step 1: Export risky users and recent risk detections
The script below keeps the risky users whose risk is still open and the risk detections of the last 30 days, and writes both to CSV. It reads metadata only, never a password, token or secret, and changes nothing.
Run it on an admin workstation as a Security Reader or Global Reader. Listing risky users needs IdentityRiskyUser.Read.All and Microsoft Entra ID P2; listing risk detections needs IdentityRiskEvent.Read.All:
Connect-MgGraph -Scopes 'IdentityRiskyUser.Read.All', 'IdentityRiskEvent.Read.All'
#Requires -Version 5.1
#Requires -Modules Microsoft.Graph.Authentication, Microsoft.Graph.Identity.SignIns
<#
.SYNOPSIS
Read-only export of Microsoft Entra ID Protection risky users and their recent risk detections.
.DESCRIPTION
Reads every riskyUser object and every user risk detection, keeps the users whose risk is still
open (atRisk or confirmedCompromised, or all users with IncludeClosed) and the detections from the
last Days days. Writes two CSV files to OutputFolder:
risky-users.csv one row per risky user, with the detection types, the source IP
addresses and the last detection in the window, and a Findings column
risk-detections.csv one row per risk detection in the window
The Findings column flags confirmed compromise, high risk, deleted users, leaked credentials,
token-related detections that MFA no longer remediates on its own, and hidden or generic values
that point to a tenant without Microsoft Entra ID P2.
The script reads metadata only: no password, token or secret. It changes nothing.
.PARAMETER OutputFolder
Existing folder for the two CSV files, for example 'C:\Reports\IdProtection'.
.PARAMETER Days
How many days of risk detections to include. Default 30. The Risk detections report keeps 90 days.
.PARAMETER IncludeClosed
Also report users whose risk is remediated, dismissed or confirmed safe.
.EXAMPLE
.\Get-EntraRiskyUserReport.ps1 -OutputFolder 'C:\Reports\IdProtection' -Days 30
.NOTES
Read-only. Makes no change in Microsoft Entra ID. Writes only the two CSV reports.
Run it in a session opened with delegated permissions:
Connect-MgGraph -Scopes 'IdentityRiskyUser.Read.All','IdentityRiskEvent.Read.All'
as a Global Reader, Security Reader, Security Operator or Security Administrator. The riskyUsers
API requires Microsoft Entra ID P2. Application permissions with the same names also work.
#>
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string]$OutputFolder,
[ValidateRange(1, 90)]
[int]$Days = 30,
[switch]$IncludeClosed
)
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
if ($null -eq (Get-MgContext)) {
throw 'No Microsoft Graph session. Run Connect-MgGraph first.'
}
if (-not (Test-Path -Path $OutputFolder -PathType Container)) {
throw "Output folder not found: $OutputFolder"
}
$cutoff = (Get-Date).ToUniversalTime().AddDays(-$Days)
$openStates = @('atRisk', 'confirmedCompromised')
# Detections that Microsoft no longer auto-remediates when the user completes MFA
$tokenTypes = @('investigationsThreatIntelligence', 'anomalousToken', 'attackerinTheMiddle', 'nationStateIP', 'tokenIssuerAnomaly')
# 1. Risky users
$riskyUsers = @(Get-MgRiskyUser -All -PageSize 500)
if (-not $IncludeClosed) {
$riskyUsers = @($riskyUsers | Where-Object { $openStates -contains $_.RiskState })
}
# 2. Risk detections in the window, grouped by user
$detections = @(Get-MgRiskDetection -All -PageSize 500 |
Where-Object { $null -ne $_.DetectedDateTime -and $_.DetectedDateTime.ToUniversalTime() -ge $cutoff })
$byUser = @{}
foreach ($group in ($detections | Group-Object -Property UserId)) {
$byUser[[string]$group.Name] = @($group.Group)
}
# 3. One row per risky user
$userRows = @(foreach ($user in $riskyUsers) {
$own = @()
if ($byUser.ContainsKey([string]$user.Id)) { $own = $byUser[[string]$user.Id] }
$types = @($own | ForEach-Object { $_.RiskEventType } | Where-Object { $_ } | Sort-Object -Unique)
$ips = @($own | ForEach-Object { $_.IPAddress } | Where-Object { $_ } | Sort-Object -Unique)
$last = $own | Sort-Object -Property DetectedDateTime -Descending | Select-Object -First 1
$findings = New-Object System.Collections.Generic.List[string]
if ($user.RiskState -eq 'confirmedCompromised') { $findings.Add('Confirmed compromised: reset the password and revoke sessions') }
if ($user.RiskState -eq 'atRisk' -and $user.RiskLevel -eq 'high') { $findings.Add('High risk, not remediated') }
if ($user.IsDeleted -eq $true) { $findings.Add('Deleted user: an administrator cannot dismiss this risk') }
if ($types -contains 'leakedCredentials') { $findings.Add('Leaked credentials: check the password changed after the detection') }
if (@($types | Where-Object { $tokenTypes -contains $_ }).Count -gt 0) { $findings.Add('Token-related detection: MFA alone does not clear it') }
if ($user.RiskLevel -eq 'hidden' -or $types -contains 'generic') { $findings.Add('Hidden or generic values: details need Microsoft Entra ID P2') }
[pscustomobject]@{
UserPrincipalName = $user.UserPrincipalName
UserId = $user.Id
RiskLevel = $user.RiskLevel
RiskState = $user.RiskState
RiskDetail = $user.RiskDetail
RiskLastUpdatedUtc = $user.RiskLastUpdatedDateTime
IsDeleted = $user.IsDeleted
IsProcessing = $user.IsProcessing
DetectionsInWindow = $own.Count
DetectionTypes = ($types -join ', ')
SourceIPs = ($ips -join ', ')
LastDetectionUtc = $(if ($last) { $last.DetectedDateTime } else { $null })
Findings = ($findings -join '; ')
}
})
# 4. One row per detection, metadata only
$detectionRows = @(foreach ($d in $detections) {
$country = $null
if ($null -ne $d.Location) { $country = $d.Location.CountryOrRegion }
[pscustomobject]@{
DetectedUtc = $d.DetectedDateTime
UserPrincipalName = $d.UserPrincipalName
UserId = $d.UserId
RiskEventType = $d.RiskEventType
RiskLevel = $d.RiskLevel
RiskState = $d.RiskState
RiskDetail = $d.RiskDetail
DetectionTimingType = $d.DetectionTimingType
Activity = $d.Activity
IPAddress = $d.IPAddress
CountryOrRegion = $country
Source = $d.Source
RequestId = $d.RequestId
CorrelationId = $d.CorrelationId
}
})
$userRows | Sort-Object -Property RiskLevel, UserPrincipalName |
Export-Csv -Path (Join-Path -Path $OutputFolder -ChildPath 'risky-users.csv') -NoTypeInformation -Encoding UTF8
$detectionRows | Sort-Object -Property DetectedUtc -Descending |
Export-Csv -Path (Join-Path -Path $OutputFolder -ChildPath 'risk-detections.csv') -NoTypeInformation -Encoding UTF8
$userRows | Sort-Object -Property @{ Expression = { $_.RiskState -eq 'confirmedCompromised' }; Descending = $true }, @{ Expression = { $_.RiskLevel -eq 'high' }; Descending = $true }, UserPrincipalName
.\Get-EntraRiskyUserReport.ps1 -OutputFolder 'C:\Reports\IdProtection' -Days 30
Example output (the values are illustrative):
UserPrincipalName : j.doe@corp.example.com
UserId : 00000000-0000-0000-0000-000000000000
RiskLevel : high
RiskState : atRisk
RiskDetail : none
RiskLastUpdatedUtc : 11/27/2026 6:41:12 PM
IsDeleted : False
IsProcessing : False
DetectionsInWindow : 3
DetectionTypes : anomalousToken, unfamiliarFeatures
SourceIPs : 198.51.100.7, 203.0.113.24
LastDetectionUtc : 11/27/2026 6:38:50 PM
Findings : High risk, not remediated; Token-related detection: MFA alone does not clear it
UserPrincipalName : a.lee@corp.example.com
UserId : 11111111-1111-1111-1111-111111111111
RiskLevel : high
RiskState : confirmedCompromised
RiskDetail : adminConfirmedUserCompromised
RiskLastUpdatedUtc : 11/25/2026 9:02:44 AM
IsDeleted : False
IsProcessing : False
DetectionsInWindow : 2
DetectionTypes : adminConfirmedUserCompromised, leakedCredentials
SourceIPs :
LastDetectionUtc : 11/25/2026 9:02:40 AM
Findings : Confirmed compromised: reset the password and revoke sessions; Leaked credentials: check the password changed after the detection
How to read the results:
- Confirmed compromised: someone already decided this account is compromised. Make sure the password was reset and the sessions revoked (Step 3).
- High risk, not remediated: no policy or administrator has acted. Start the investigation here.
- Token-related detection: completing MFA during sign-in no longer remediates these detections (Step 3).
- Hidden or generic values: Microsoft returns these in place of details that need P2.
Step 2: Investigate a risky user
Microsoft's investigation framework puts self-remediation first where it's available; an investigation then decides whether the risk is safe, compromised or to be dismissed.
Work through the risk reports
- Sign in to the Microsoft Entra admin center as at least a Security Reader and browse to ID Protection > Dashboard for the counts of attacks and high-risk users.
- Open the Risky users report and select a user. The details show a timeline of risk events; select Aggregate risk signals by risky sign-ins to see the user's risky sign-ins in the same view.
- Open Risky sign-ins, which keeps up to 30 days and shows interactive and non-interactive sign-ins. Each sign-in shows the application, the Conditional Access policies applied, the MFA details, the device and location, and the real-time and aggregate risk levels.
- Open Risk detections, which keeps up to 90 days and shows the attack type based on MITRE ATT&CK and other risks triggered at the same time.
For each risky sign-in, ask whether the application, the device (registered or compliant), the location, the IP address and the user agent are normal for this user. Then look wider:
- Other users: shared IP addresses, locations or other common characteristics can point to more compromised accounts; consider blocking them with Conditional Access.
- What the account touched: data downloads and administrative changes after the sign-in.
- Other alerts: in the Microsoft Defender portal, open Incidents & alerts > Alerts and filter Product name to AAD Identity Protection.
- The user: confirm the details with them, knowing that their email or Teams account might be compromised too.
Read the risk history (read-only)
The risk history records each change to the user's risk and who made it, which is how you find the administrator behind an Admin confirmed user compromised detection. Run it as a Security Reader:
Connect-MgGraph -Scopes 'IdentityRiskyUser.Read.All'
Get-MgRiskyUserHistory -RiskyUserId '00000000-0000-0000-0000-000000000000' -All |
Sort-Object RiskLastUpdatedDateTime |
Select-Object RiskLastUpdatedDateTime, RiskLevel, RiskState, RiskDetail, InitiatedBy,
@{ Name = 'RiskEventTypes'; Expression = { $_.Activity.RiskEventTypes -join ', ' } }
InitiatedBy holds the ID of the actor that made the change.
Checks for common detections
| Detection | What to check | If the activity wasn't the user |
|---|---|---|
| Password spray | Other users with sign-ins that share the user agent, application, protocol, IP or ASN range, or timing | Mark the sign-in compromised and reset the password; block the user and revoke all tokens if the attacker can reset the password or complete MFA |
| Leaked credentials | Whether the password changed after the leak was detected, and sign-ins from unfamiliar locations or anonymous IP addresses | Confirm the user compromised and reset the password; block, reset and revoke refresh tokens if the attacker is active; check for new app registrations and mailbox rule changes |
| Anomalous token, token issuer anomaly | Location, application, IP address and user agent that don't fit the user | Mark the sign-in compromised and reset the password; block the user if the attacker can reset the password |
| Atypical travel | Recent travel, or a sanctioned VPN | Mark the sign-in compromised and reset the password; for a sanctioned VPN, confirm the sign-in safe and add the range to named locations |
| Microsoft Entra threat intelligence | The additional info field: a suspicious IP address, a password spray, or a real-time rule number that other users share | Check other users for the same IP address, spray pattern or rule, then remediate as for that attack |
| Malicious IP address | Whether the user works from that IP address | Confirm the sign-in compromised and reset the password; if the attacker can reset the password or complete MFA, block the user and revoke all tokens |
Confirm compromised, confirm safe or dismiss?
Every user-level action applies to all detections currently associated with the user, and only Reset password changes the password:
| Action | Use it when | Effect on risk |
|---|---|---|
| Confirm user compromised | True positive | Sets user risk to high and adds an Admin confirmed user compromised detection; the user stays risky until remediated |
| Confirm user safe | False positive | Removes risk and detections and puts the user back in learning mode |
| Dismiss user risk | Benign positive: real but not malicious, such as a known penetration test | Sets the risk level to none; similar users keep being evaluated |
| Reset password | The account is compromised | Remediates the risk and revokes current sessions |
| Block user | An attacker may be able to reset the password or complete MFA | Blocks sign-in |
Sign-ins have their own Confirm sign-in compromised, Confirm sign-in safe and Dismiss sign-in risk actions. Confirming a sign-in compromised raises the user's risk and the sign-in's aggregate risk, not its real-time risk, to high.
Step 3: Remediate a compromised user
Record the decision, then act on the account. Microsoft's remediation article has you confirm the compromise and then, if no risk-based policy has remediated it, take one or more of these actions:
- Confirm the user compromised in the Risky users report, or with the script below.
- Block the user if you suspect the attacker can reset the password or complete MFA.
- Reset the password. In the user's risk details, select Reset password to generate a temporary password that the user must change at the next sign-in. The risk state becomes Remediated.
- Revoke refresh tokens, and with continuous access evaluation, all access tokens.
- Disable devices that you consider compromised.
Revoking sessions invalidates the user's refresh tokens and browser session cookies, so they must sign in again to every application. It can take a few minutes, and it doesn't revoke sessions of external users. It needs User.RevokeSessions.All; preview it with -WhatIf:
Connect-MgGraph -Scopes 'User.RevokeSessions.All'
Revoke-MgUserSignInSession -UserId '00000000-0000-0000-0000-000000000000' -WhatIf
Microsoft stopped auto-remediating sessions with MFA claims when Microsoft Entra threat intelligence, Anomalous token, Attacker in the Middle, Verified threat actor IP or Token issuer anomaly fires during sign-in. With a user risk policy, these users must complete a secure password change and reauthenticate with MFA.
For a hybrid user, you can reset the password from on-premises Active Directory instead, but only with password hash synchronization, the ID Protection setting Allow on-premises password change to reset user risk and self-service password reset all in place. Select User must change password at next logon only after those are on.
Change a user's risk state with Microsoft Graph (changes configuration)
The portal actions have Graph equivalents: riskyUser: dismiss, riskyUser: confirmSafe and riskyUser: confirmCompromised. Microsoft's Graph reference for dismiss and its two companions require IdentityRiskyUser.ReadWrite.All and name Security Administrator as the least privileged role. The script records each user's current risk to CSV before it acts, supports -WhatIf and -Confirm, and skips deleted users when dismissing or confirming safe:
Connect-MgGraph -Scopes 'IdentityRiskyUser.Read.All', 'IdentityRiskyUser.ReadWrite.All'
#Requires -Version 5.1
#Requires -Modules Microsoft.Graph.Authentication, Microsoft.Graph.Identity.SignIns
<#
.SYNOPSIS
Dismisses, confirms safe or confirms compromised the risk of Microsoft Entra ID Protection risky users.
.DESCRIPTION
For each user ID, reads the current riskyUser object, appends its risk level, state and detail to
a CSV record, then sends one action through Microsoft Graph:
Dismiss riskyUser: dismiss. Sets the user's risk level to none. Use it for a benign
positive. It doesn't change the user's password.
ConfirmSafe riskyUser: confirmSafe. Sets the user's risk level to none. Use it for a
false positive.
ConfirmCompromised riskyUser: confirmCompromised. Sets the user's risk level to high, so a user
risk policy makes the user remediate at the next sign-in.
Users that can't be read as risky users are skipped. Deleted users are skipped for Dismiss and ConfirmSafe,
because administrators can't dismiss their risk. The CSV record is written before any change, also
under -WhatIf, so the previous state stays on record; Graph has no action that restores it.
Run it with -WhatIf first. Each user asks for confirmation unless you pass -Confirm:$false.
.PARAMETER UserId
Object IDs of the risky users, for example '00000000-0000-0000-0000-000000000000'.
.PARAMETER Action
Dismiss, ConfirmSafe or ConfirmCompromised.
.PARAMETER RecordPath
Path of the CSV record of the previous risk state, for example 'C:\Reports\IdProtection\risk-actions.csv'.
New rows are appended.
.EXAMPLE
.\Set-EntraRiskyUserState.ps1 -UserId '00000000-0000-0000-0000-000000000000' -Action ConfirmCompromised -RecordPath 'C:\Reports\IdProtection\risk-actions.csv' -WhatIf
.NOTES
Changes configuration. Changes the risk state of users in Microsoft Entra ID Protection.
Run it in a session opened with delegated permissions (Read.All for reading each risky user,
ReadWrite.All for the actions):
Connect-MgGraph -Scopes 'IdentityRiskyUser.Read.All','IdentityRiskyUser.ReadWrite.All'
as a Security Administrator, the least privileged role Microsoft Graph supports for these actions.
The riskyUsers API requires Microsoft Entra ID P2.
#>
[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'High')]
param(
[Parameter(Mandatory = $true)]
[ValidatePattern('^[0-9a-fA-F-]{36}$')]
[string[]]$UserId,
[Parameter(Mandatory = $true)]
[ValidateSet('Dismiss', 'ConfirmSafe', 'ConfirmCompromised')]
[string]$Action,
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string]$RecordPath
)
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
if ($null -eq (Get-MgContext)) {
throw 'No Microsoft Graph session. Run Connect-MgGraph first.'
}
$recordFolder = Split-Path -Path $RecordPath -Parent
if ($recordFolder -and -not (Test-Path -Path $recordFolder -PathType Container)) {
throw "Record folder not found: $recordFolder"
}
switch ($Action) {
'Dismiss' { Write-Warning 'Dismiss sets the risk level to none and does not change the password. If the account may be compromised, reset the password and revoke sessions instead.' }
'ConfirmCompromised' { Write-Warning 'ConfirmCompromised raises user risk to high. A user risk policy then requires remediation at the next sign-in; a user who cannot complete MFA is blocked.' }
}
$now = (Get-Date).ToUniversalTime()
foreach ($id in $UserId) {
# 1. Current state
try {
$user = Get-MgRiskyUser -RiskyUserId $id
}
catch {
Write-Warning "Could not read $id as a risky user, skipped: $($_.Exception.Message)"
continue
}
if ($user.IsDeleted -eq $true -and $Action -ne 'ConfirmCompromised') {
Write-Warning "$($user.UserPrincipalName) is deleted; administrators can't dismiss its risk. Skipped."
continue
}
# 2. Record of the previous state, written even under -WhatIf
[pscustomobject]@{
RecordedUtc = $now
UserPrincipalName = $user.UserPrincipalName
UserId = $user.Id
Action = $Action
PreviousRiskLevel = $user.RiskLevel
PreviousRiskState = $user.RiskState
PreviousRiskDetail = $user.RiskDetail
PreviousRiskUpdatedUtc = $user.RiskLastUpdatedDateTime
} | Export-Csv -Path $RecordPath -NoTypeInformation -Encoding UTF8 -Append -WhatIf:$false
# 3. The action
$target = "$($user.UserPrincipalName) ($id), risk $($user.RiskLevel) / $($user.RiskState)"
if ($PSCmdlet.ShouldProcess($target, $Action)) {
try {
switch ($Action) {
'Dismiss' { Invoke-MgDismissRiskyUser -UserIds @($id) -Confirm:$false }
'ConfirmSafe' { Confirm-MgRiskyUserSafe -UserIds @($id) -Confirm:$false }
'ConfirmCompromised' { Confirm-MgRiskyUserCompromised -UserIds @($id) -Confirm:$false }
}
[pscustomobject]@{ User = $user.UserPrincipalName; Action = $Action; PreviousRiskLevel = $user.RiskLevel; Status = 'Sent' }
}
catch {
Write-Warning "$($user.UserPrincipalName): $($_.Exception.Message)"
[pscustomobject]@{ User = $user.UserPrincipalName; Action = $Action; PreviousRiskLevel = $user.RiskLevel; Status = 'Failed' }
}
}
}
Preview the confirmation of one compromised user:
.\Set-EntraRiskyUserState.ps1 -UserId '00000000-0000-0000-0000-000000000000' -Action ConfirmCompromised -RecordPath 'C:\Reports\IdProtection\risk-actions.csv' -WhatIf
WARNING: ConfirmCompromised raises user risk to high. A user risk policy then requires remediation at the next sign-in; a user who cannot complete MFA is blocked.
What if: Performing the operation "ConfirmCompromised" on target "j.doe@corp.example.com (00000000-0000-0000-0000-000000000000), risk high / atRisk".
Run it again without -WhatIf to send the action. In limited cases, Microsoft may remediate an account itself when it has high-confidence evidence of compromise that poses an active risk; those actions appear in the audit log with Microsoft as the initiator, and you can reverse them after your own investigation.
Step 4: Turn on self-remediation with risk-based Conditional Access
Risk-based Conditional Access is the automation of everything above: when a user completes the required control, ID Protection remediates the risk without an administrator. Microsoft's risk policy configuration guide asks you to investigate and remediate active risks before you enable the policies. Create two separate policies, because Microsoft warns against combining the sign-in risk and user risk conditions in one, and start both in report-only mode. Sign in as at least a Conditional Access Administrator, browse to Entra ID > Conditional Access and select New policy.
| Setting | Where | Recommended value | Effect |
|---|---|---|---|
| Users | Users or workload identities | Include All users; exclude the emergency access accounts | Covers everyone except the accounts that must never be locked out |
| Target resources | Target resources > Include | All resources | Applies to every application |
| User risk (user risk policy) | Conditions > User risk | High | Triggers when user risk reaches high |
| Grant (user risk policy) | Grant > Grant access | Require risk remediation, with the Require authentication strength that it adds | Password users make a secure password change after MFA; passwordless users have their sessions revoked and sign in again |
| Session (user risk policy) | Session | Sign-in frequency > Every time, applied automatically and mandatory | Forces reauthentication after the sessions are revoked |
| Sign-in risk (sign-in risk policy) | Conditions > Sign-in risk | High and Medium | Triggers on medium and high sign-in risk |
| Grant (sign-in risk policy) | Grant > Grant access | Require authentication strength > Multifactor authentication; for passwordless users, Passwordless MFA or Phishing-resistant MFA | A successful MFA remediates the sign-in risk |
| Session (sign-in risk policy) | Session | Sign-in frequency > Every time | Requires reauthentication for each risky sign-in |
| State | Enable policy | Report-only, then On | Lets you check the impact first |
The levels are Microsoft's recommendation; choosing High alone reduces prompts but leaves Low and Medium risk unchallenged. A few rules from Microsoft's description of risk-based access policies affect the design:
- Precedence: Require risk remediation overrides Require password change, and Block overrides both, so assign each user to one risk policy.
- Guests: Require risk remediation isn't supported for external and guest users, because Microsoft Entra ID can't revoke their sessions.
- User risk only: Require risk remediation remediates user risk, not sign-in risk.
- Preview control: Require Identity Verification (preview), which needs an identity verification profile, is independent of Require risk remediation.
- Own password changes don't count: changing a known password outside the flow isn't a secure password change; a self-service password reset does remediate user risk.
Check the Microsoft-managed risk policies
Microsoft-managed Conditional Access policies include three user and sign-in risk policies: Multifactor authentication and reauthentication for risky sign-ins, Block access for high-risk users and Require remediation for high-risk users. Microsoft creates them in report-only mode and, if you leave them there, turns them on no less than 30 days later, sooner in some cases. You can exclude identities or switch them off but can't rename or delete them, so add the emergency access exclusion early. Microsoft doesn't create the remediation policy when the tenant already has an enabled user risk policy of its own.
Migrate the legacy ID Protection risk policies
As of November 2026, Microsoft's risk policy articles still carry the warning that the legacy user risk and sign-in risk policies configured in ID Protection retire on October 1, 2026. If your tenant still has one enabled:
- Create the equivalent policies in Conditional Access in report-only mode, as above.
- After you confirm the impact, switch them to On.
- Browse to ID Protection > Dashboard, select the User risk or Sign-in risk policy, and set Enforce policy to Disabled.
The last step needs a Security Administrator, the least privileged role Microsoft's remediation article names for editing the risk-based policies in ID Protection. The retirement notice names only the risk policies; the MFA registration policy is still configured in ID Protection.
Step 5: Investigate risky workload identities
A workload identity is an identity that lets an application or service principal access resources, sometimes in the context of a user. It can't perform MFA, often has no formal lifecycle and has to store its credentials somewhere, so Microsoft calls it harder to manage and more exposed to compromise. Microsoft's workload identity risk article covers single-tenant, non-Microsoft SaaS and multitenant apps; managed identities currently aren't in scope.
| Workload identity detection | riskEventType |
|---|---|
| Microsoft Entra threat intelligence | investigationsThreatIntelligence |
| Suspicious Sign-ins | suspiciousSignins |
| Admin confirmed service principal compromised | adminConfirmedServicePrincipalCompromised |
| Leaked Credentials | leakedCredentials |
| Malicious application | maliciousApplication |
| Suspicious application | suspiciousApplication |
| Anomalous service principal activity | anomalousServicePrincipalActivity |
| Suspicious API Traffic | suspiciousAPITraffic |
All eight are calculated offline. Find them under ID Protection > Risky workload identities, signed in as at least a Security Reader. The riskyServicePrincipals and servicePrincipalRiskDetections APIs need Workload Identities Premium (Microsoft Entra Workload ID Premium in the Graph reference). This read-only check lists open workload identity risk and the detections:
Connect-MgGraph -Scopes 'IdentityRiskyServicePrincipal.Read.All', 'IdentityRiskEvent.Read.All'
Get-MgRiskyServicePrincipal -All |
Where-Object { $_.RiskState -in 'atRisk', 'confirmedCompromised' } |
Select-Object DisplayName, AppId, Id, ServicePrincipalType, IsEnabled, RiskLevel, RiskState, RiskLastUpdatedDateTime
Get-MgServicePrincipalRiskDetection -All |
Select-Object DetectedDateTime, ServicePrincipalDisplayName, AppId, RiskEventType, RiskLevel, RiskState, IPAddress
Ask whether the account shows suspicious sign-ins, unauthorized credential changes, suspicious configuration changes or unauthorized application roles. If it's compromised, remediate it in this order:
- Inventory every credential on the service principal and its application object.
- Add a new credential; Microsoft recommends an x509 certificate.
- Remove the compromised credentials, or all existing ones if you believe the account is at risk.
- Rotate any Azure Key Vault secrets the service principal can reach.
Then record the decision. In the report, select Confirm compromised, Dismiss or Disable service principal; through Graph, the actions need IdentityRiskyServicePrincipal.ReadWrite.All and the Security Administrator role, and one dismiss request takes up to 60 service principals:
Connect-MgGraph -Scopes 'IdentityRiskyServicePrincipal.ReadWrite.All'
Confirm-MgRiskyServicePrincipalCompromised -ServicePrincipalIds '22222222-2222-2222-2222-222222222222' -WhatIf
Invoke-MgDismissRiskyServicePrincipal -ServicePrincipalIds '22222222-2222-2222-2222-222222222222' -WhatIf
To block a risky workload identity automatically, create a Conditional Access policy for workload identities with Service principal risk as the condition. Block access is the only grant control, it covers single-tenant service principals registered in your tenant, and it needs Workload Identities Premium. Assign the service principal directly: a policy assigned to a group that contains it isn't enforced for it.
Step 6: Export risk data and automate the response
Export risk data to Log Analytics, then automate the response with notifications, playbooks or scripts. As of November 2026, Microsoft's export guidance lists these built-in retention periods:
| Report or signal | Microsoft Entra ID Free | P1 | P2 |
|---|---|---|---|
| Audit logs | 7 days | 30 days | 30 days |
| Sign-ins | 7 days | 30 days | 30 days |
| Risky sign-ins | 7 days | 30 days | 30 days |
To keep risk data longer, sign in as at least a Security Administrator, browse to Entra ID > Monitoring & health > Diagnostic settings, select + Add diagnostic setting, pick the categories and a Log Analytics workspace, and save. Data can take around 15 minutes to appear. The category you enable isn't the table you query:
| Report | Diagnostic setting category | Log Analytics table |
|---|---|---|
| Risky users | RiskyUsers | AADRiskyUsers |
| Risk detections (users) | UserRiskEvents | AADUserRiskEvents |
| Risky workload identities | RiskyServicePrincipals | AADRiskyServicePrincipals |
| Workload identity detections | ServicePrincipalRiskEvents | AADServicePrincipalRiskEvents |
The same page adds RiskyAgents and AgentRiskEvents for agent identities. Send the sign-in and audit logs too; the queries below use them.
Three more documented options automate the response:
- Email notifications. ID Protection sends a Users at risk detected email when a user reaches the level you set, High by default, and a weekly digest. Configure it under ID Protection > Dashboard > Users at risk detected alerts. Recipients are users actively assigned Global Administrator, Security Administrator or Security Reader with an email address; group-assigned roles don't receive it.
- Microsoft Sentinel playbooks. Microsoft's Sentinel solution for Microsoft Entra ID Protection includes the Logic Apps playbooks Confirm-EntraIDRiskyUser and Dismiss-EntraIDRiskyUser, which set a user's risk from an incident or alert through Microsoft Graph.
- Scheduled scripts. Both scripts here accept application permissions of the same names with certificate-based app-only authentication, which Microsoft's Graph PowerShell article for ID Protection shows. That article also bulk-dismisses high-risk users not updated for 90 days; we'd do that only after reviewing each user.
Verify
Check the users you acted on, the policies and a lab test.
| Check | Expected result |
|---|---|
Get-EntraRiskyUserReport.ps1 |
No Confirmed compromised or High risk, not remediated row without an open ticket |
Get-MgRiskyUser for a user you acted on |
RiskState reads dismissed, confirmedSafe, confirmedCompromised or remediated as expected, and IsProcessing is False |
| Risk policy listing below | A user risk policy and a sign-in risk policy with state enabled and the expected grant controls |
| Conditional Access What If for an emergency access account | No risk policy applies |
| A lab test user, not registered for MFA, signing in with Tor Browser | An anonymous IP address detection, which Microsoft says appears within 10 to 15 minutes |
| Microsoft Entra audit log | A record for each action, under the activity names in Monitor and detect |
Check one user's state after an action:
Get-MgRiskyUser -RiskyUserId '11111111-1111-1111-1111-111111111111' |
Select-Object UserPrincipalName, RiskLevel, RiskState, RiskDetail, IsProcessing, RiskLastUpdatedDateTime
This read-only command lists the Conditional Access policies with a user, sign-in or service principal risk condition. It needs Policy.Read.All and a role such as Global Reader or Security Reader. The Prefer header opts in to riskRemediation, the value whose name matches Require risk remediation, which Microsoft Graph otherwise leaves out of the response:
Connect-MgGraph -Scopes 'Policy.Read.All'
Get-MgIdentityConditionalAccessPolicy -All -Headers @{ Prefer = 'include-unknown-enum-members' } |
Where-Object { $_.Conditions.UserRiskLevels -or $_.Conditions.SignInRiskLevels -or $_.Conditions.ServicePrincipalRiskLevels } |
Select-Object DisplayName, State,
@{ Name = 'UserRisk'; Expression = { $_.Conditions.UserRiskLevels -join ',' } },
@{ Name = 'SignInRisk'; Expression = { $_.Conditions.SignInRiskLevels -join ',' } },
@{ Name = 'WorkloadRisk'; Expression = { $_.Conditions.ServicePrincipalRiskLevels -join ',' } },
@{ Name = 'Grant'; Expression = { $_.GrantControls.BuiltInControls -join ',' } }
DisplayName State UserRisk SignInRisk WorkloadRisk Grant
----------- ----- -------- ---------- ------------ -----
Require remediation for ... enabled high riskRemediation
Risky sign-ins require MFA enabled high,medium
A policy that requires only an authentication strength shows an empty Grant column, because the strength is a separate property.
Roll back
A risk action can't be undone, only followed by another, and some leave a trace.
| Change | How to roll back | Notes |
|---|---|---|
| Dismissed user risk | Confirm the user compromised to raise the risk to high again | Microsoft Graph has no action that restores the previous risk; the script's CSV record only documents it |
| Confirmed compromised | Remediate with a password reset, or dismiss after the investigation | The user's risk history shows who confirmed it |
| Confirmed safe | Confirm the user compromised if new evidence appears | Confirm safe removes the risk and detections and restarts learning mode |
| Revoked sessions | Not reversible | Refresh tokens issued before the revocation stay invalid; users sign in again |
| Risk-based Conditional Access policy | Set it back to Report-only, or exclude affected users | Microsoft suggests excluding users or disabling the policy if it blocks legitimate users; dismiss their risk if they still can't sign in |
| Allow on-premises password change to reset user risk | Clear the check box in the ID Protection settings | Microsoft describes it as an opt-in feature |
| Workload identity confirm or dismiss | Send the other action | As for users, no action restores the previous risk |
Monitor and detect
Watch the administrator actions as closely as the risk, because an attacker with a security role can clear risk to keep a compromised account usable. Microsoft lists these ID Protection activities in the audit log, and the related policy changes:
| Activity (audit log) | What it records | Related pages |
|---|---|---|
| DismissUser, DismissRisk | Risk dismissed for a user or a sign-in | Rules for risk cleared or ID Protection policies changed |
| ConfirmAccountSafe, ConfirmSafe | A user or a sign-in confirmed safe | Same rules |
| ConfirmAccountCompromised, ConfirmCompromised | A user or a sign-in confirmed compromised | The second query below |
| DismissServicePrincipal, confirmServicePrincipalCompromised | Dismiss or confirm compromised for a workload identity | The ID Protection rules above cover the dismissal |
| Update IdentityProtectionPolicy | A change to an ID Protection policy | The same ID Protection rules |
| Update Conditional Access policy | A change to a Conditional Access policy, including a risk policy | Rules for weakened or deleted Conditional Access policies |
Microsoft's audit activity reference lists the eight risk action names under ID Protection in the audit category Other, and Update IdentityProtectionPolicy in the category IdentityProtection. The risk detections themselves map to Forestall's detection rules:
| Risk detections | Detection rules |
|---|---|
passwordSpray |
Password spraying rules |
leakedCredentials |
Leaked credentials rules |
anomalousToken, attackerinTheMiddle, attemptedPrtAccess |
Token theft and adversary-in-the-middle rules |
authenticatorPhishing, userReportedSuspiciousActivity |
MFA fatigue rules |
suspiciousCredentialAddition |
Rules for MFA methods registered by an attacker |
investigationsThreatIntelligence, maliciousIPAddress, nationStateIP |
High-risk sign-in rules |
tokenIssuerAnomaly |
Federated domain backdoor rules |
suspiciousAPITraffic |
Directory enumeration rules |
maliciousApplication, suspiciousApplication |
Rules for applications Microsoft flags as malicious |
Workload identity leakedCredentials, suspiciousSignins, anomalousServicePrincipalActivity |
Leaked service principal credential rules |
The queries below use columns from the Azure Monitor table references for AADRiskyUsers, AADUserRiskEvents, AuditLogs, SigninLogs, AADNonInteractiveUserSignInLogs, AADRiskyServicePrincipals and AADServicePrincipalRiskEvents. The first lists users whose risk is still open:
// Users whose latest exported risk state is still open, highest risk first.
// Needs the RiskyUsers diagnostic setting category (table AADRiskyUsers). The lookback must cover the last risk change.
AADRiskyUsers
| where TimeGenerated > ago(90d)
| summarize arg_max(TimeGenerated, *) by Id
| where RiskState in ("atRisk", "confirmedCompromised") and IsDeleted == false
| extend LevelOrder = case(RiskLevel == "high", 1, RiskLevel == "medium", 2, 3)
| project RiskLastUpdatedDateTime, UserPrincipalName, Id, RiskLevel, RiskState, RiskDetail, LevelOrder
| order by LevelOrder asc, RiskLastUpdatedDateTime desc
The second lists every risk action and flags the case worth a closer look: an actor whose latest open risk detection fell in the week before the action.
// ID Protection risk actions, flagged when the actor's latest open risk detection fell in the 7 days before the action.
// Needs the audit logs and the UserRiskEvents category (tables AuditLogs, AADUserRiskEvents).
let RiskActions = dynamic(["DismissUser", "DismissRisk", "ConfirmSafe", "ConfirmAccountSafe", "ConfirmCompromised", "ConfirmAccountCompromised", "DismissServicePrincipal", "confirmServicePrincipalCompromised"]);
let ActorsAtRisk = AADUserRiskEvents
| where TimeGenerated > ago(37d)
| where RiskState == "atRisk"
| summarize LastRiskDetection = max(DetectedDateTime), RiskTypes = make_set(RiskEventType) by UserId;
AuditLogs
| where TimeGenerated > ago(30d)
| where OperationName in~ (RiskActions)
| extend ActorId = tostring(InitiatedBy.user.id)
| extend Actor = coalesce(tostring(InitiatedBy.user.userPrincipalName), tostring(InitiatedBy.app.displayName))
| join kind=leftouter ActorsAtRisk on $left.ActorId == $right.UserId
| extend ActorHadOpenRisk = isnotnull(LastRiskDetection) and LastRiskDetection between ((TimeGenerated - 7d) .. TimeGenerated)
| project TimeGenerated, OperationName, Result, Actor, TargetResources, ActorHadOpenRisk, RiskTypes, CorrelationId
| order by ActorHadOpenRisk desc, TimeGenerated desc
The third returns successful sign-ins rated medium or high whose risk was still open when the record was written:
// Successful sign-ins rated medium or high risk whose record shows the risk still open.
// Needs the user and non-interactive user sign-in logs in the workspace; the risk columns need Microsoft Entra ID P2.
// RiskState is the state when the record was written: check the Risky sign-ins report for later changes.
union SigninLogs, AADNonInteractiveUserSignInLogs
| where TimeGenerated > ago(7d)
| where ResultType == "0"
| where RiskLevelDuringSignIn in ("medium", "high") or RiskLevelAggregated in ("medium", "high")
| where RiskState == "atRisk"
| project TimeGenerated, Type, UserPrincipalName, UserId, AppDisplayName, IPAddress, Location, RiskLevelDuringSignIn, RiskLevelAggregated, RiskEventTypes_V2, ConditionalAccessStatus, CorrelationId
| order by TimeGenerated desc
The fourth does the same as the first for workload identities:
// Service principals whose latest exported risk state is still open, with their detections.
// Needs the RiskyServicePrincipals and ServicePrincipalRiskEvents categories; full details need Workload Identities Premium.
let Detections = AADServicePrincipalRiskEvents
| where TimeGenerated > ago(90d)
| summarize DetectionCount = dcount(Id), RiskTypes = make_set(RiskEventType), LastDetection = max(DetectedDateTime) by ServicePrincipalId;
AADRiskyServicePrincipals
| where TimeGenerated > ago(90d)
| summarize arg_max(TimeGenerated, *) by Id
| where RiskState in ("atRisk", "confirmedCompromised")
| join kind=leftouter Detections on $left.Id == $right.ServicePrincipalId
| project RiskLastUpdatedDateTime, DisplayName, AppId, Id, ServicePrincipalType, AccountEnabled, RiskLevel, RiskState, RiskTypes, DetectionCount, LastDetection
| order by RiskLastUpdatedDateTime desc
Common mistakes with risky users
Most of these mistakes hide a compromise behind a dismissal or leave users with a policy they can't satisfy.
| Mistake | Why it hurts | Do this instead |
|---|---|---|
| Dismissing a user whose account might be compromised | Dismissal doesn't change the password, so the identity isn't back in a safe state | Reset the password and revoke sessions; dismiss only proven benign activity |
| Asking users to change their password on their own | A change outside the risk remediation flow isn't a secure password change | Let the user risk policy prompt them, or use an administrator reset or self-service password reset |
| Enabling a user risk policy before users register MFA | Unregistered users are blocked and need an administrator | Run the MFA registration policy first |
| Synchronized users without password writeback | Microsoft requires writeback for their self-remediation | Turn on password writeback before the policy |
| One policy with both risk conditions | Microsoft warns against it | Create a user risk policy and a separate sign-in risk policy |
| A user in several risk policies | Block overrides every other control | Assign each user to one risk policy |
| Keeping the legacy ID Protection policies | Microsoft set their retirement for October 1, 2026 | Migrate to Conditional Access |
| Treating MFA as the fix for token detections | Microsoft no longer auto-remediates them with MFA during sign-in | Require a secure password change and revoke sessions |
| No log export | Risky sign-ins are kept 30 days at most | Send the risk categories to Log Analytics |
Troubleshooting
Many risky user problems trace back to MFA registration, password writeback, licensing or roles.
| Symptom | Cause | Fix |
|---|---|---|
| A risky user is blocked instead of prompted to remediate | The user isn't registered for MFA, or is a synchronized user without password writeback | Generate a temporary password, then fix the registration or writeback gap |
| Sign-in fails with error 50053 and "Sign-in was blocked by built-in protections due to high confidence of risk." | ID Protection blocks sign-ins with very high confidence of risk, most often over legacy authentication | Add the sign-in IP addresses to trusted locations if they're yours, or move the client to modern authentication |
| User risk stays after the user changed the password | The change happened outside the remediation flow, or on-premises without the opt-in setting | Use the policy flow, an administrator reset, or enable Allow on-premises password change to reset user risk with password hash synchronization |
| The Risky users report shows only medium and high users with no details | The tenant has Microsoft Entra ID Free or P1 | License Microsoft Entra ID P2 |
| Detections show only Additional risk detected | Premium detections without P2 | License Microsoft Entra ID P2 |
| Dismiss user risk isn't possible for a user | The user was deleted from the directory | Open a Microsoft support case |
| Action buttons are greyed out | The role can't take that action | Use a higher privileged role (see Roles you need) |
| A detection appears hours after the sign-in | Offline detections can take up to 48 hours | Wait, and check the risk history |
| A guest isn't covered by the remediation policy | Require risk remediation isn't supported for external and guest users | Investigate guest risk manually |
| No Users at risk detected email arrives | The recipient holds the role through a group, or is eligible in PIM but not elevated | Assign the role directly, or add a custom recipient |
How Forestall helps
Forestall's CAP Audit shows in its User Summary which Conditional Access protections currently apply to each user, which helps when you investigate a compromised account. Each Conditional Access policy page restates the policy in plain language, including sign-in and user risk conditions. The AZ_RESET_PASSWORD edge shows who can reset a user's password, and AZ_PASSWORD_WRITEBACK marks where a cloud reset reaches on-premises Active Directory. Identity Attack Surface Management maps these identities and their trust relationships across Active Directory, Entra ID and Azure without agents.
Frequently Asked Questions
What is Microsoft Entra ID Protection?
Microsoft Entra ID Protection is the Microsoft Entra service that detects identity-based risk, such as leaked credentials, password spray and anomalous tokens, and turns it into a sign-in risk and a user risk level. Administrators investigate the risk in the risky users, risky sign-ins and risk detections reports, and risk-based Conditional Access policies let users remediate it. Full use requires Microsoft Entra ID P2 or Microsoft Entra Suite.
What is the difference between user risk and sign-in risk?
In Microsoft Entra ID Protection, sign-in risk is the probability that a specific authentication request wasn't made by the account owner, and it's calculated during and after each sign-in. User risk is the probability that the identity itself is compromised, built from all active detections on the user. Users remediate sign-in risk by completing MFA and user risk by a secure password change, or by signing in again when they're passwordless.
What does dismiss user risk do?
In Microsoft Entra ID Protection, dismissing user risk sets a risky user's risk level to none and closes the detections currently associated with the user. Microsoft intends it for a benign positive: risk that is real but not malicious, such as a known penetration test. It doesn't change the password, so the identity isn't brought back into a safe state. Security Operator can dismiss in the portal; Graph names Security Administrator.
What happens when you confirm a user compromised?
Confirming a user compromised tells ID Protection the risk is a true positive. It sets the user's risk to high and adds an Admin confirmed user compromised detection, and the user stays risky until remediated. If a user risk policy covers the user, the user remediates through that policy at the next sign-in. Confirming compromise doesn't reset the password or revoke sessions, so do both yourself.
Which license does Entra ID Protection require?
As of November 2026, Microsoft's licensing page says ID Protection requires Microsoft Entra ID P2, with the same access in Microsoft Entra Suite and Microsoft 365 E7. Free and P1 tenants see limited reports: only medium and high risk users, without details or risk history, and premium detections appear as Additional risk detected. Full workload identity risk details need Workload Identities Premium.
Are the legacy ID Protection risk policies retired?
Microsoft set October 1, 2026 as the retirement date for the user risk and sign-in risk policies configured in ID Protection, and as of November 2026 its articles still tell tenants to migrate. Recreate both in Conditional Access in report-only mode, switch them on, then disable the old policies under ID Protection. The MFA registration policy remains configured in ID Protection.
Related guides
- Set up break glass accounts in Entra ID: accounts every risk policy excludes.
- Block device code flow with Conditional Access: close a flow that phishing abuses.
- Harden Entra Connect and Cloud Sync: password hash synchronization and writeback for hybrid users.
- Set up Microsoft Entra PIM: limit who holds Security Administrator.
- Microsoft Entra ID security checklist for beginners: where ID Protection fits among the basics.
References
- What are risk detections? (Microsoft Learn)
- Risk detection types and levels (Microsoft Learn)
- Microsoft Entra licensing (Microsoft Learn)
- How to investigate risk (Microsoft Learn)
- Remediate risks and unblock users (Microsoft Learn)
- Configure and enable risk policies (Microsoft Learn)
- Risk-based access policies (Microsoft Learn)
- Microsoft-managed Conditional Access policies (Microsoft Learn)
- Securing workload identities (Microsoft Learn)
- How To: Export risk data (Microsoft Learn)
- riskyUser: dismiss (Microsoft Graph)
- Valid Accounts: Cloud Accounts, T1078.004 (MITRE ATT&CK)
See your identity exposure clearly.
Start with a 1-day Proof of Value in your own environment.