i am need help creating a KQL query to find out when and who created a new user

Peter Snydert 0 Reputation points
2025-04-09T07:20:45.3333333+00:00

i am need help creating a KQL query to find out when and who created a new user

Microsoft Sentinel
Microsoft Sentinel
A scalable, cloud-native solution for security information event management and security orchestration automated response. Previously known as Azure Sentinel.
1,268 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Goutam Pratti 4,325 Reputation points Microsoft External Staff
    2025-04-09T14:21:36.98+00:00

    Hello @Peter Snydert ,

    I Understand you need help to create KQL query to find out when and who created a new user.

    Here is the KQL query which can help you to achieve your ask.

    AuditLogs
    | where OperationName == "Add user"
    | project TimeGenerated, InitiatedBy = tostring(InitiatedBy.user.userPrincipalName),
    CreatedUser = tostring(TargetResources[0].userPrincipalName),
    CreatedUserDisplayName = tostring(TargetResources[0].displayName),
    ActivityDisplayName
    | sort by TimeGenerated desc

    User's image I have tested the same in my tenant and is working as expected. Let me know if you have any further questions feel free to post back. Please remember to "Accept Answer" if answer helped, so that others in the community facing similar issues can easily find the solution.


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.