dsquery.exe

by Microsoft
Operating Systemhigh risk

Sources: 300M+ executions observed in the wild.

Summary

Directory Service Query (dsquery.exe) queries Active Directory for objects matching specified criteria. It can search for users, computers, groups, OUs, contacts, and other AD objects.

dsquery.exe is the 205th most commonly executed Windows program in EchoTrail's dataset, observed 69,337 times across enterprise environments. It typically runs from C:\Windows\System32 and it is most often launched by cmd.exe.

Get this in your tools

The same record for dsquery.exe, by REST or as an MCP tool. Free key, no card.

Get a free key
curl -H "Authorization: Bearer $ECHOTRAIL_KEY" \
  https://api.echotrail.io/v1/process/dsquery.exe

Free returns the summary. Team returns the full record you see on this page. Endpoint docs

205th
most commonly executed Windows program
69,337
observed endpoint executions

Behavior

Top Paths

  • C:\Windows\System32100%

Top Hashes (SHA256)

  • fca06a6daca63cc713660538ce1330debe37c82539d02786964fe4d20eaea78a100%

Process Ancestry

Top Parents

Security Analysis

What does dsquery.exe normally do?

Located in C:\Windows\System32. In this dataset, exclusively launched by cmd.exe. Only present on systems with AD DS tools installed (domain controllers, admin workstations with RSAT).

When is dsquery.exe suspicious?

Any execution on a non-admin workstation. Queries for domain admins, enterprise admins, or other privileged groups. Broad computer or user enumeration. Combined with other AD enumeration tools (dsget, adfind, net group /domain).

How do attackers abuse dsquery.exe?

Active Directory reconnaissance: attackers use dsquery to enumerate domain users, computers, groups, and organizational units to map the AD environment and identify high-value targets. dsquery user -name * or dsquery computer enumerates the entire directory.

Detection guidance

Medium-confidence: any dsquery execution on a non-admin workstation or non-domain controller. dsquery user or dsquery computer with broad criteria. High-confidence: dsquery combined with other AD enumeration in sequence. dsquery spawned by unusual parents (wmiprvse.exe, wsmprovhost.exe).

False positive notes

AD administrators use dsquery for legitimate directory management. Monitoring and inventory tools may query AD. Baseline normal dsquery usage per user and workstation.

MITRE ATT&CK techniques

Related Processes

Ask Rocky about dsquery.exe

Rocky is the free chat demo. It answers from this same dataset, no account needed.

This page is the Team-tier API record for dsquery.exe. The free tier returns the summary, 500 lookups a month. Or ask Rocky.