Query Details

Determine Which Users Are Running Which Processes

Query

// Use Case: Identifying and analyzing unique processes executed by Windows user accounts while sorting the results by user and process name for security or auditing purposes.
Process
| project WindowsUserAccount, ProcessName, ProcessId, CommandLine
| distinct WindowsUserAccount, ProcessName, ProcessId, CommandLine
| order by WindowsUserAccount, ProcessName

Explanation

This query is designed to help identify and analyze the unique processes that have been executed by Windows user accounts. Here's a simple breakdown of what it does:

  1. Selects Specific Data: It focuses on four key pieces of information from the Process data: the Windows user account, the process name, the process ID, and the command line used to start the process.

  2. Filters for Uniqueness: It ensures that each combination of user account, process name, process ID, and command line is unique. This means it removes any duplicate entries from the results.

  3. Sorts the Results: Finally, it organizes the data by sorting it first by the Windows user account and then by the process name.

Overall, this query helps in auditing or security analysis by providing a clear and organized view of the distinct processes run by each user on a Windows system.

Details

Ugur Koc profile picture

Ugur Koc

Released: December 13, 2024

Tables

Process

Keywords

ProcessWindowsUserAccountProcessNameProcessIdCommandLineSecurityAuditing

Operators

projectdistinctorder by

Actions

GitHub