Given a suspected compromised network segment(s), access to a system that can access and view the list of AD accounts as is.
Operator Note: Identifying all AD domain accounts allows responders to detect new or unauthorized accounts created by threat actors.
Operator Note: Ensure export includes key attributes (account name, status, OU) for effective analysis.
All users of the domain are enumerated and any newly created accounts will be identified.
Operator Note: Reported user list should be shared with mission owner and reviewed for suspicious accounts, disabled accounts re-enabled, and naming convention anomalies.
Get-ADUser -Filter *
$dcUsers = Get-ADUser -Filter *
$dcUsers.Count
Example:
6609
Get-ADUser -Filter { Enabled -eq "False" } | Select-Object SamAccountName
dsquery * -limit 0
Example:
"CN=Sochan\, Carlenel,OU=Users,OU=Santa Ana,DC=team01,DC=tgt"
"CN=Team01-WK4355,OU=Computers,OU=Los Angeles,DC=team01,DC=tgt"
Operator Note: dsquery output provides Distinguished Name (DN), useful for OU and account path analysis.
2.16_ListADDomainAccounts.ps1
script:.\2.16_ListADDomainAccounts.ps1
[+] Current Domain: team01.tgt
[+] There are 6609 users in team01.tgt
[+] Writing domain users to all_ad_domain_accounts.txt...
[+] Done!
C:\Path\To\all_ad_domain_accounts.txt
Install RSAT (if missing):
Add-WindowsCapability -Online -Name "Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0"
net user /domain
Operator Note: PowerView should be used carefully and only when authorized. ADExplorer is suitable for offline review.
PowerShell AD Module Cmdlets
Sysinternals ADExplorer
Platform | Tool | Purpose |
---|---|---|
Windows | PowerShell + AD Module | Primary AD user enumeration |
Windows | dsquery | Legacy quick command |
Universal | ADExplorer | GUI-based AD object viewer |
Advanced (Windows/Linux) | PowerView | Advanced AD enumeration (optional use) |
Get-ADUser -Filter * | Export-Csv -Path C:\ADUsers.csv -NoTypeInformation
Search-ADAccount -AccountDisabled | Select-Object Name, Enabled
Date | Version | Description | Author |
---|---|---|---|
2025-05-02 | 1.8 | Full original + enriched AD user enumeration tooling, PowerShell scripts, and operator recommendations | Leo |