Audit Windows Server logons and correlate RDP attempts
When a Remote Desktop client reports a logon failure, immediately resetting the password can erase useful diagnostic clues. An incorrect account name, rejected credentials, and a connection that never reaches authentication are different problems. The Windows Server Security log can record authentication results, but only if the audit policy is effective and the query covers the right time window.
This guide uses local accounts on Windows Server 2022 to build a troubleshooting workflow: verify the policy, run controlled tests, correlate event fields, and export the original records. For RootAMD dedicated servers, view the credentials in the console after payment, then connect using RDP. If multiple addresses are listed, use the first one. Run the following commands in an authorized administrator PowerShell session. These steps do not change listener settings or access rules.
1. Confirm audit coverage first
Logon events are recorded in the Security log. Reading that log and adjusting audit policy require the appropriate permissions. Before starting, record the server name, the client's public egress address, the test account, and the time on both systems. Do not record passwords. Use an explicitly qualified local account name to avoid confusion with a domain account of the same name.
First, create a restricted evidence directory and back up the existing audit policy. The directory must be in a location accessible only to authorized administrators. Check the inherited permissions before using the path below:
$Evidence = Join-Path $env:ProgramData (
'RdpAudit-' + (Get-Date -Format 'yyyyMMdd-HHmmss')
)
New-Item -ItemType Directory -Path $Evidence | Out-Null
Get-Acl $Evidence | Format-List
auditpol /backup /file:"$Evidence\audit-before.csv"
auditpol /get /subcategory:"{0CCE9215-69AE-11D9-BED3-505054503030}"
This GUID identifies the Logon audit subcategory without relying on the system's display language. Save the query results. If success or failure auditing is disabled, enable it only with authorization for the change:
auditpol /set /subcategory:"{0CCE9215-69AE-11D9-BED3-505054503030}" /success:enable /failure:enable
auditpol /get /subcategory:"{0CCE9215-69AE-11D9-BED3-505054503030}"
Domain Group Policy may overwrite local settings, so a successful command does not mean the policy will remain effective. Check it again before and after testing. If the settings revert, investigate which policy controls them rather than repeatedly running the enable command.
Do not repeatedly try incorrect passwords just to generate failure events. First confirm the effective account lockout policy, then use a dedicated test account. If you cannot establish how many attempts remain before lockout, skip the failure test.
2. Verify collection with a controlled connection
Keep the current management session open and test through a separate client connection. Do not experiment with the management connection you are actively using. First, log on once with valid credentials. Record when you click Connect and when the desktop appears, then sign out of the test session normally.
If the account policy permits it, try one incorrect password with the test account, then stop. A client may perform several authentication negotiations during a single action, so one click does not guarantee a single event. End the test immediately if there is any indication of a lockout.
Interpret events by authentication stage
Event 4624 indicates a successful logon; 4625 indicates a failed logon. Logon type 10 in a 4624 event represents a remote interactive logon, but it does not prove that desktop initialization has finished. Network Level Authentication and other authentication stages may also involve type 3. Do not filter for type 10 alone and then conclude that no failure events exist.
If no matching event appears, first check when auditing became effective and which time range the log covers. Then determine whether the connection reached authentication on this server. Network failures before authentication, rejections by other components, and authentication processing in a domain environment can all change where you need to look for evidence.
3. Extract named fields, not the full message text
Event Viewer descriptions are useful for manual review, but their text depends on the system language. Automated queries should read field names from the XML rather than rely on fixed indexes in Properties. Field layouts are not identical across events.
The following query retrieves both event types from the last fifteen minutes and sorts them by time:
$Start = (Get-Date).AddMinutes(-15)
$Rows = Get-WinEvent -FilterHashtable @{
LogName = 'Security'
Id = 4624,4625
StartTime = $Start
} -ErrorAction Stop | ForEach-Object {
[xml]$Xml = $_.ToXml()
$Data = @{}
foreach ($Item in $Xml.Event.EventData.Data) {
$Data[[string]$Item.Name] = [string]$Item.'#text'
}
[pscustomobject]@{
TimeUtc = $_.TimeCreated.ToUniversalTime().ToString('o')
RecordId = $_.RecordId
EventId = $_.Id
User = $Data['TargetUserName']
Domain = $Data['TargetDomainName']
Type = $Data['LogonType']
Address = $Data['IpAddress']
Status = $Data['Status']
SubStatus = $Data['SubStatus']
LogonId = $Data['TargetLogonId']
}
}
$Rows = $Rows | Sort-Object TimeUtc
$Rows | Format-Table -AutoSize
$Rows | Export-Csv (Join-Path $Evidence 'logons.csv') `
-NoTypeInformation -Encoding UTF8
Handle “no matching events” separately from “access denied.” Do not reinterpret a command error as evidence that no logon occurred. It is normal for successful logon events to lack failure status fields; do not fill them with invented status values.
4. Assess failure reasons separately from source evidence
Read Status and SubStatus together. For example, 0xC000006D commonly indicates a logon failure, while substatus 0xC000006A points to an incorrect password and 0xC0000064 to a nonexistent user. An account lockout may appear as 0xC0000234. Use the actual event to establish field placement and the specific combination of values. Do not automatically reset an account based on a single status match.
A source address is not a person's identity
The source may be behind address translation or an access device. It may also be blank, a loopback address, or another intermediate endpoint. The same address does not prove the same person was involved, and different addresses do not prove that multiple people used the account. Correlate the time window, target account, logon type, and client-side test notes together.
TargetLogonId can help correlate subsequent activity on the same machine, but it is not a permanent identifier across reboots or machines. RecordId locates a record within this log; it is not a globally unique event number.
The collection process has a basic level of credibility only when both the incorrect-password test and the successful logon can be correlated. If only successful events appear, recheck failure auditing and the authentication path first. If authentication succeeds but the desktop stalls, investigate session initialization and application issues rather than continuing to guess at password problems.
5. Export the original events and verify the evidence
CSV is convenient for filtering, but it is not a complete original record. For a handoff, also save an EVTX file and document the time window, filter criteria, and export time. The following command exports events from the fifteen minutes preceding execution. Its time window differs from the earlier query, so check the record IDs to confirm that the intended tests are included.
$Evtx = Join-Path $Evidence 'logons.evtx'
$Query = '*[System[(EventID=4624 or EventID=4625) and TimeCreated[timediff(@SystemTime) <= 900000]]]'
wevtutil epl Security "$Evtx" "/q:$Query" /ow:true
if ($LASTEXITCODE -ne 0) {
throw 'Event export failed'
}
Get-WinEvent -Path $Evtx -MaxEvents 5 |
Select-Object TimeCreated, Id, RecordId
Get-FileHash $Evtx -Algorithm SHA256 |
Format-List |
Out-File (Join-Path $Evidence 'evtx-sha256.txt') -Encoding UTF8
The hash helps detect changes to the file after export; it does not prove that the log was never modified. When submitting a support ticket, provide only the information needed to resolve the issue. Share account names and source addresses only within the authorized scope, and do not place the original evidence in a public directory.
Finally, verify that the test events can be read back from the EVTX file, that CSV timestamps consistently use UTC, and that the original record IDs match. If auditing was enabled only for this investigation, restore that subcategory to its previous settings. Restoring the entire policy backup is appropriate only after confirming that no concurrent policy changes have occurred. Verification is complete when a known action can be linked to a readable, explainable event—not merely when the log contains more entries.
Frequently asked questions
Does a missing 4625 event rule out a logon attempt?
No. Check failure auditing, log retention coverage, and whether the connection reached authentication. An earlier rejection may not generate the expected event on this server.
Does event 4624 with logon type 10 prove the desktop works?
No. It identifies a remote interactive logon. Correlate the account, time, and source, then test desktop initialization and the business application from the client.
RootAMD EPYC 7543P Dedicated Server
From $456.3/month