Differentiate between failed and interrupted sign-in logs with Get-MgAuditLogSignIn

Emilia Owens 0 Reputation points
2026-04-30T02:45:10.4833333+00:00

Hi All,

I am using the Microsoft.Graph PowerShell Module to fetch Entra sign-in logs with the cmdlet Get-MgAuditLogSignIn.

The object returned by that cmdlet has a property 'Status' of the type MicrosoftGraphSignInStatus, with the properties AdditionalDetails, AdditionalProperties, ErrorCode & FailureReason. While I am able to easily differentiate between successful and failed/interrupted sign-in attempts as any status with an ErrorCode above 0 is reporting some kind of error, there doesn't seem to be any way I can differentiate between the 'Failure' and 'Interrupted' statuses as seen in the Entra admin center.

Is there any mapping that shows a connection between the error code and the status, or any other way of determining the status?

Here you can see the comparison between what is seen in the Entra admin center vs what is seen in PowerShell:

User's imageUser's image

Microsoft Security | Microsoft Graph
0 comments No comments

1 answer

Sort by: Newest
  1. AI answer

    2026-04-30T02:45:28.38+00:00

    The sign-in logs exposed through Get-MgAuditLogSignIn don’t surface the same high‑level Status values (“Success”, “Failure”, “Interrupted”) that are shown in the Entra admin center. In PowerShell and Microsoft Graph, the only status information available is the status object on each sign‑in record, which contains:

    • errorCode
    • failureReason
    • additionalDetails

    From these fields, only errorCode cleanly distinguishes success vs. non‑success:

    • status/errorCode = 0 → successful sign‑in
    • status/errorCode ≠ 0 → sign‑in not successful (covers both what the portal labels as Failure and Interrupted)

    The documentation and cmdlet reference for Get-MgAuditLogSignIn describe how to query sign‑ins (including filtering on status/errorCode) but do not define or expose any mapping between specific error codes and the portal’s “Failure” vs. “Interrupted” labels, nor any separate field that carries that classification.

    Therefore, using Get-MgAuditLogSignIn alone, sign-ins can be programmatically separated into:

    • Successful: status/errorCode = 0
    • Unsuccessful (failed or interrupted): status/errorCode ≠ 0

    but there is no supported way in the API or PowerShell to further distinguish Failure from Interrupted as shown in the Entra admin center.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

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