T1087.002

Domain Account

Adversaries may attempt to get a listing of domain accounts to aid in follow-on behavior such as targeting accounts with specific privileges. Commands such as net user /domain and net group /domain, PowerShell cmdlets like Get-ADUser and Get-ADGroupMember, LDAP queries via ldapsearch or BoomBox-style programmatic enumeration, and tools like AdFind and CrackMapExec are commonly used. This information helps adversaries identify high-value targets such as domain administrators, service accounts, and privileged users.

Microsoft Sentinel / Defender
kusto
let DomainEnumProcesses = dynamic(["net.exe", "net1.exe"]);
let ADToolNames = dynamic(["adfind.exe", "adfind", "nltest.exe", "dsquery.exe", "ldifde.exe", "csvde.exe", "dsget.exe", "crackmapexec.exe", "cme.exe", "bloodhound.exe", "sharphound.exe"]);
let DomainEnumArgs = dynamic(["/domain", "domain admins", "domain users", "domain controllers", "enterprise admins", "schema admins", "get-aduser", "get-adgroupmember", "get-adgroup", "get-adcomputer", "samaccountname", "distinguishedname"]);
let LDAPQueryPatterns = dynamic(["ldap://", "ldap:\\\\", "objectclass=user", "objectclass=person", "samaccounttype", "useraccountcontrol"]);
// Detect net.exe and net1.exe domain account enumeration
let NetDomainEnum = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ (DomainEnumProcesses)
| where ProcessCommandLine has_any ("/domain", "domain admins", "domain users", "domain controllers", "enterprise admins")
| extend EnumType = case(
    ProcessCommandLine has "user" and ProcessCommandLine has "/domain", "net user /domain",
    ProcessCommandLine has "group" and ProcessCommandLine has "/domain", "net group /domain",
    ProcessCommandLine has "accounts" and ProcessCommandLine has "/domain", "net accounts /domain",
    "net /domain other"
  )
| extend TechniqueSource = "net.exe";
// Detect PowerShell AD module usage
let PSADEnum = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ ("powershell.exe", "pwsh.exe")
| where ProcessCommandLine has_any ("Get-ADUser", "Get-ADGroupMember", "Get-ADGroup", "Get-ADComputer", "Get-ADObject", "Get-ADDomain", "Get-ADForest", "Get-DomainUser", "Get-DomainGroupMember", "Get-DomainGroup", "Get-NetUser", "Get-NetGroup")
| extend EnumType = case(
    ProcessCommandLine has "Get-ADUser", "Get-ADUser",
    ProcessCommandLine has "Get-ADGroupMember", "Get-ADGroupMember",
    ProcessCommandLine has "Get-DomainUser", "Get-DomainUser (PowerView)",
    ProcessCommandLine has "Get-NetUser", "Get-NetUser (PowerView)",
    "PowerShell AD Enum"
  )
| extend TechniqueSource = "PowerShell";
// Detect known AD enumeration tools
let ADToolEnum = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName has_any (ADToolNames) or InitiatingProcessFileName has_any (ADToolNames)
| where ProcessCommandLine has_any ("user", "group", "objectclass", "samaccountname", "domain", "ldap")
| extend EnumType = "AD Enumeration Tool"
| extend TechniqueSource = FileName;
// Combine results
union NetDomainEnum, PSADEnum, ADToolEnum
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine, EnumType, TechniqueSource
| sort by Timestamp desc
medium severity high confidence

Data Sources

Process: Process Creation Command: Command Execution Microsoft Defender for Endpoint

Required Tables

DeviceProcessEvents

False Positives

  • IT administrators legitimately running net user /domain or net group /domain commands during troubleshooting or account management tasks
  • Helpdesk staff using Get-ADUser or Get-ADGroupMember in PowerShell for user management operations
  • Monitoring and identity governance tools (e.g., SailPoint, Varonis, CyberArk) that periodically enumerate AD accounts as part of access reviews
  • HR or provisioning automation scripts that enumerate domain groups when onboarding or offboarding users
  • Domain controller health check scripts or scheduled tasks that enumerate accounts as part of routine auditing

Unlock Pro Content

Get the full detection package for T1087.002 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections