Query Details
AuditLogs
| where TimeGenerated > ago(90d)
| where OperationName has_any("Reset password (self-service)","Change user password")
| where Result == "success"
| extend Target = tostring(TargetResources[0].userPrincipalName)
| extend TargetId = TargetResources[0].id
| extend DisplayName = tostring(TargetResources[0].userPrincipalName)
| extend initiator =iff(isempty(parse_json(tostring(InitiatedBy.user)).userPrincipalName),parse_json(tostring(InitiatedBy.app)).displayName,(parse_json(tostring(InitiatedBy.user)).userPrincipalName))
| extend IPAddress= parse_json(tostring(InitiatedBy.user)).ipAddress
This KQL (Kusto Query Language) query is designed to analyze audit logs and identify successful password reset or change operations that occurred within the last 90 days. Here's a simplified breakdown of what the query does:
Data Source: It starts by accessing the AuditLogs table.
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 include only those where the operation was either a "Reset password (self-service)" or "Change user password".
Result Filter: It ensures that only successful operations are considered by checking if the Result is "success".
Extract Target Information:
Target.TargetId.DisplayName.Extract Initiator Information:
initiator.Extract IP Address: It extracts the IP address from which the operation was initiated and stores it in a column called IPAddress.
In summary, this query retrieves and organizes information about successful password reset or change operations from the audit logs, including details about the target user, the initiator, and the IP address involved.

Jay Kerai
Released: December 2, 2025
Tables
Keywords
Operators