Entra Account Disabled
Query
AuditLogs
| where TimeGenerated > ago(90d)
| where OperationName == "Disable account"
| where Result == "success"
| extend Target = tostring(TargetResources[0].userPrincipalName)
| extend TargetId = TargetResources[0].id
| extend DisplayName = tostring(TargetResources[0].userPrincipalName)
| extend Initator =iff(isempty(parse_json(tostring(InitiatedBy.user)).userPrincipalName),parse_json(tostring(InitiatedBy.app)).displayName,(parse_json(tostring(InitiatedBy.user)).userPrincipalName))
| project TimeGenerated, Initator, Target,TargetId,DisplayName,IPAddress= parse_json(tostring(InitiatedBy.user)).ipAddressExplanation
This KQL (Kusto Query Language) query is designed to analyze audit logs and identify successful account disablement actions within the last 90 days. Here's a simplified breakdown of what the query does:
-
Data Source: It starts by looking at the
AuditLogstable. -
Time Filter: It filters the logs to include only those generated in the last 90 days.
-
Operation Filter: It further narrows down the logs to only include entries where the operation performed was "Disable account."
-
Result Filter: It ensures that only successful operations are considered by checking if the result was "success."
-
Data Extraction:
- It extracts the
userPrincipalNameof the target account (the account that was disabled) and assigns it to a new column calledTarget. - It extracts the
idof the target account and assigns it to a new column calledTargetId. - It duplicates the
userPrincipalNameof the target account into a new column calledDisplayName. - It determines who initiated the account disablement. If the action was initiated by a user, it extracts the
userPrincipalName; if initiated by an application, it extracts the application'sdisplayName. This information is stored in a new column calledInitator.
- It extracts the
-
Projection: Finally, it selects and displays the following columns in the output:
TimeGenerated: The time when the log entry was created.Initator: The user or application that initiated the account disablement.Target: The userPrincipalName of the account that was disabled.TargetId: The ID of the account that was disabled.DisplayName: The userPrincipalName of the account that was disabled (same asTarget).IPAddress: The IP address of the user who initiated the action.
In summary, this query provides a list of successful account disablement actions over the past 90 days, including details about the target account and the initiator of the action.
Details

Jay Kerai
Released: December 2, 2025
Tables
Keywords
Operators