dsquery.exe

by Microsoft
Operating Systemhigh risk

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.

205th
most commonly executed Windows program
69,337
observed executions
medium
statistical confidence

Behavior

Top Paths

  • C:\Windows\System32100%

Top Hashes (SHA256)

  • fca06a6daca63cc713660538ce1330debe37c82539d02786964fe4d20eaea78a100%

Process Ancestry

Top Parents

Rare or environment-specific process names are omitted from ancestry tables. Percentages are of all observed relationships.

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 answers questions about dsquery.exe grounded in this same dataset — free, no account needed.

Need this data programmatically? The Rocky API includes 500 free lookups a month. Or just ask Rocky.

Data from EchoTrail's dataset of ~346M Windows process executions. Last extracted 2026-08-04.