Query Details
//Summarize the accounts in your environment using cleartext LDAP connections
//Data connector required for this query - M365 Defender - Identity* tables
//Microsoft Sentinel query
IdentityLogonEvents
| where TimeGenerated > ago (30d)
| where LogonType == "LDAP cleartext"
| summarize
['Total connection count']=count(),
['Distinct destination device count']=dcount(DestinationDeviceName),
['List of destination devices']=make_set(DestinationDeviceName)
by AccountUpn
| sort by ['Distinct destination device count'] desc
//Advanced Hunting query
//Data connector required for this query - Advanced Hunting license
IdentityLogonEvents
| where Timestamp > ago (30d)
| where LogonType == "LDAP cleartext"
| summarize
['Total connection count']=count(),
['Distinct destination device count']=dcount(DestinationDeviceName),
['List of destination devices']=make_set(DestinationDeviceName)
by AccountUpn
| sort by ['Distinct destination device count'] desc This query summarizes the accounts in your environment that are using cleartext LDAP connections. It counts the total number of connections, the number of distinct destination devices, and provides a list of the destination devices for each account. The results are sorted by the number of distinct destination devices in descending order.

Matt Zorich
Released: June 17, 2022
Tables
Keywords
Operators