Given access to a Domain Controller (DC), a domain account with appropriate permissions, and an incident response workstation with RSAT tools and PowerShell.
Operator Note: Monitoring and detecting new accounts in AD is critical during incident response to identify potential unauthorized accounts created by adversaries.
All new accounts created during the timeframe of interest are identified, exported, and validated.
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4720; StartTime=(Get-Date).AddDays(-7)} |
Select-Object TimeCreated, Id, Message |
Export-Csv .\NewAccounts.csv -NoTypeInformation
Operator Note: Adjust
AddDays(-7)
as needed to specify timeframe of incident.
A user account was created.
Subject:
Security ID: DOMAIN\Administrator
Account Name: Administrator
Account Domain: DOMAIN
Logon ID: 0x1A8B2
New Account:
Security ID: DOMAIN\newuser
Account Name: newuser
Get-ADUser -Filter * -Properties whenCreated |
Where-Object { $_.whenCreated -ge (Get-Date).AddDays(-7) } |
Select-Object Name, SamAccountName, whenCreated |
Export-Csv .\RecentADAccounts.csv -NoTypeInformation
Operator Note: This queries based on AD object creation time.
Auditpol /set /category:"Account Management" /success:enable /failure:enable
Operator Note: This must be done in advance or during active incident monitoring.
$events = Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4720; StartTime=(Get-Date).AddDays(-7)}
$events | Export-Csv ".\NewADAccounts.csv" -NoTypeInformation
Store this file in the incident response working folder for analysis and reporting.
Tool | Platform | Use Case |
---|---|---|
PowerShell + Event Logs | Windows | Primary method for detection |
PowerShell + Get-ADUser | Windows | Quick check based on whenCreated attribute |
Event Viewer (GUI) | Windows | Manual review |
SIEM (Splunk, Sentinel, etc.) | Windows/Linux | Enterprise level aggregation and monitoring |
WMI Event Subscriptions (optional advanced use) | Windows | Real-time event capture (rarely used in IR) |
whenCreated
) to cross-validate events.Microsoft Event ID 4720 Documentation
PowerShell Get-ADUser Cmdlet
Auditpol Command
Date | Version | Description | Author |
---|---|---|---|
2025-05-02 | 1.0 | Fully generated operator guide with event log monitoring, PowerShell procedures, tooling, checklist, best practices | Leo |