Query Details
```kql //Advanced Hunting query to detect NTLM usage in the environment // All credit for this query goes to Matt Zorich IdentityLogonEvents | where Timestamp > ago(7d) | where ActionType == "LogonSuccess" | where Protocol =~ "Ntlm" | where LogonType == "Credentials validation" | summarize ['Target Device List']=make_set(DestinationDeviceName), ['Target Device Count']=dcount(DestinationDeviceName) by DeviceName, AccountName | sort by ['Target Device Count'] desc ```
This query is designed to identify and analyze the use of NTLM (NT LAN Manager) authentication in a network environment over the past seven days. Here's a simplified breakdown of what it does:
Data Source: It examines logon events from the IdentityLogonEvents table.
Time Frame: It focuses on events that occurred within the last seven days.
Filter Criteria:
ActionType == "LogonSuccess").Protocol =~ "Ntlm").LogonType == "Credentials validation").Data Aggregation:
DestinationDeviceName) where NTLM logons occurred.Sorting:
In essence, this query helps identify which accounts and devices are most frequently using NTLM authentication, potentially highlighting areas for security review or improvement.

Nathan Hutchinson
Released: February 12, 2026
Tables
Keywords
Operators