About Get-SecurityAlert command

Shuai Dawei 20 Reputation points
2025-08-08T01:56:05.74+00:00

I am running Get-SecurityAlert command to retrive alert from MDE

but the problem is the command is not retriving all alerts
also it retrive risky signin alerts as well which is not my requirement
I want to retrive the alerts of MDE only

I search every where but I couldnot found anything
I am using delegate permission here
my company wants me without registering apps as possible as I can
So,Anyone can help in this would be great help

Thank you in advance

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. Michele Ariis 2,520 Reputation points MVP
    2025-08-08T06:58:38.36+00:00

    Hi, got the problem: Get-SecurityAlert brings you all providers (including AIP “risky sign-ins”). Without registering apps, use Microsoft Graph PowerShell with delegation and filter only MDEs. Here, super-synthetic: open an InPrivate session → Connect-MgGraph -Scopes "SecurityEvents.Read.All" → MDE only: Get-MgSecurityAlertV2 -All -Filter "serviceSource eq 'microsoftDefenderForEndpoint'" (if you don't have V2: Get-MgSecurityAlert -All -Filter "vendorInformation/provider eq 'Microsoft Defender for Endpoint'"). To exclude risky sign-ins: add and serviceSource to 'azureAdIdentityProtection' (or, on v1, and category to 'Risky sign-in'). If it doesn't get them all, it's pagination: use -All (or -PageSize 1000) and, if necessary, repeat with Invoke-MgGraphRequest following the @odata.nextLink. You can also narrow by date: ... and createdDateTime ge 2025-08-01T00:00:00Z. This way, you only get Microsoft Defender for Endpoint alerts with delegated permissions and without having to register your own app.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Vasil Michev 121K Reputation points MVP Volunteer Moderator
    2025-08-08T06:41:56.7666667+00:00

    I suppose you mean Get-MgSecurityAlert, correct? Keep in mind that this cmdlet is using the old/legacy alert experience, which is going to be deprecated next year. Instead, you should use the Get-MgSecurityAlertV2 cmdlet. And of course, make sure you have sufficient permissions, both on the Graph side and on MDE side.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.