Security & Threat Intelligence · 20.08.2026, 13:16 UTC
Using Microsoft Graph and Powershell - Risk Detection Commands, (Thu, Aug 20th)
| Schweregrad | high aktiv ausgenutzt (KEV) |
|---|---|
| Kategorie | Security & Threat Intelligence |
| Quelle | SANS Internet Storm Center ↗ |
| Veröffentlicht | 20.08.2026 UTC |
Sicherheitsmeldung mit Schweregrad hoch. Sie wird laut CISA-KEV aktiv ausgenutzt und sollte priorisiert behandelt werden. Technische Details im Tab „Originaltext“; empfohlene Schritte in der Checkliste.
Building on the last diary on Using MS Graph and Powershell, let's look at "Risky" logins.
Risky logins are a derived set of parameters that look at various (you guessed it) risky login parameters. What is considered a risk? In most cases this is either impossible geography - in other words "we're not expecting to see you at that IP, in that subnet, ASN or country", or unusual device - ie "that's not your regular computer"
There are two groups of commands in this area. You can do Risk Detection in a basic Entra license, but to work with Persistent Risk User accounts you need to bump up your license. So it'll cost you every month to use these commands:
Get-MgRiskyUser Confirm-MgRiskyUserCompromised Get-MgRiskyUserHistory
However, you can get a fair way with a basic Entra license and the Get-MgRiskDetection command. Let's focus on just that, since we all have at least that license level (if you're still reading that is).
#first connect to graph with the right Identity Protection scopes Connect-MgGraph -Scopes "IdentityRiskyUser.Read.All", "IdentityRiskEvent.Read.All" $riskylogins = Get-MgRiskDetection -all
Note that if you've already done remediation and marked off events as dealt with, you can filter those events out with:
$riskylogins = Get-MgRiskDetection -All -Filter "riskState ne 'dismissed' and riskState ne 'remediated'"
Let's look at some data:
$riskylogins | select userdisplayname, activitydatetime, ipaddress, additionalinfo
hmm, that last field is the key one, it's in JSON format, with more info than we likely want for a summary. Let's look at one …