Last active
February 26, 2022 08:06
-
-
Save alexmags/9226fdce69367319eaa7dd7afbac8fcb to your computer and use it in GitHub Desktop.
Logins with local administrator access report - Defender for Endpoint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DeviceLogonEvents | |
| where Timestamp >= ago(30d) // last month | |
| where IsLocalAdmin == 1 | |
// number of machines connected to by the account | |
| summarize count() by DeviceName, AccountName,LogonType // ,AdditionalFields | |
| sort by AccountName | |
// also see https://www.verboon.info/2020/09/hunting-for-local-group-membership-changes/ | |
// https://blog.alexmags.com/tags/kql/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Mo
Interactive is a string value so try put it in quotes.
Run the first few lines (before the sumarize command) to get the whole dataset.
Then make it look pretty with project, summarize, sort commands.
Line 3 could be
| where IsLocalAdmin == 1 and LoginType == 'Interactive'