Skip to content
SIEMBench
100% Client-Side Tool • Inputs Never Sent to Our Servers

Event ID 4742

Event ID 4742: Computer Account Changed

A computer account was changed

Log source
Security
How to enable it
Account Management > Audit Computer Account Management (Success)
Category
Persistence
Priority
High
Typical volume
High
MITRE ATT&CK

What Event ID 4742 means

4742 is written on a domain controller when a computer object changes. Computers rotate their own password every 30 days and update their own service names, so most events have the computer itself as subject and can be set aside.

The interesting remainder is change by someone else. An anonymous subject that sets the password of a domain controller is the mark of Zerologon exploitation. A user who adds service principal names that begin with GC/ to a workstation is preparing DCShadow. New delegation settings allow a computer to impersonate users to other services.

As in 4738, unchanged attributes appear as a dash. ComputerAccountChange is a legacy field and is always a dash. The fields with content are the change.

Key fields to inspect

FieldMeaningSuspicious when
TargetUserName Computer account that changed, ending in $. A domain controller, certificate authority or other tier-0 server.
SubjectUserName Who made the change. ANONYMOUS LOGON, or a user instead of the computer itself.
PasswordLastSet New time of the last password change. A value for a domain controller with an anonymous subject.
ServicePrincipalNames Service names, if changed. GC/ or E3514235-4B06-11D1-AB04-00C04FC2DCD2 on a host that is not a domain controller.
AllowedToDelegateTo Services the computer may delegate to. ldap, cifs or host on a domain controller.
NewUacValue Account flags after the change. 0x100 (server trust) on a computer that is not a domain controller, or 0x2000 (trusted for delegation).
DnsHostName DNS name, if changed. The name of a domain controller on another computer object, as in certificate spoofing attacks.

Detection queries

List computer account changes made by an anonymous session or by someone other than the computer. Adjust names and thresholds to your environment. About these queries.

Splunk SPL

index=windows source="XmlWinEventLog:Security" EventCode=4742
| where SubjectUserName="ANONYMOUS LOGON" OR (lower(SubjectUserName)!=lower(TargetUserName) AND (ServicePrincipalNames!="-" OR AllowedToDelegateTo!="-" OR DnsHostName!="-"))
| table _time Computer SubjectUserName TargetUserName PasswordLastSet ServicePrincipalNames AllowedToDelegateTo DnsHostName

Microsoft Sentinel KQL

SecurityEvent
| where EventID == 4742
| extend ServicePrincipalNames = extract(@'Name="ServicePrincipalNames">([^<]*)<', 1, EventData)
| extend DnsHostName = extract(@'Name="DnsHostName">([^<]*)<', 1, EventData)
| where SubjectUserName =~ "ANONYMOUS LOGON" or (SubjectUserName !~ TargetUserName and (ServicePrincipalNames !in ("", "-") or AllowedToDelegateTo !in ("", "-") or DnsHostName !in ("", "-")))
| project TimeGenerated, SubjectUserName, TargetUserName, PasswordLastSet, ServicePrincipalNames, AllowedToDelegateTo, DnsHostName

PowerShell

Get-WinEvent -FilterHashtable @{ LogName = 'Security'; Id = 4742; StartTime = (Get-Date).AddDays(-7) } |
  ForEach-Object { $d = @{ Time = $_.TimeCreated }; ([xml]$_.ToXml()).Event.EventData.Data | ForEach-Object { $d[$_.Name] = $_.'#text' }; [pscustomobject]$d } |
  Where-Object { $_.SubjectUserName -ne $_.TargetUserName } |
  Select-Object Time, SubjectUserName, TargetUserName, PasswordLastSet, ServicePrincipalNames, DnsHostName | Format-List

Attack scenarios

Zerologon (CVE-2020-1472)

The exploit sets a domain controller's password to empty over Netlogon. The event shows ANONYMOUS LOGON as subject, the controller as target and a new PasswordLastSet, and replication (4662) often follows at once.

DCShadow

A workstation is registered briefly as a domain controller to push changes into the directory. Service names that begin with GC/ are added and removed within seconds.

Certificate spoofing through DnsHostName

In CVE-2022-26923, a user changes the DNS name of a computer they own to that of a domain controller and requests a certificate. Unpatched environments then accept it as the controller.

Investigation checklist

  1. Check whether the subject is the computer itself. If so, it is probably routine.
  2. For an anonymous subject, isolate the controller and look for 4662 and 4624 in the same minute.
  3. Record service name and delegation changes before anyone reverts them.
  4. List who created the computer object, using 4741.

Common benign causes

Event ID 4742 FAQ

Does ANONYMOUS LOGON in 4742 always mean Zerologon?

Not always. Normal secure-channel password changes have been recorded with an anonymous subject on some systems. A domain controller as target, an unexpected time and an external source make it far more serious. Confirm against Netlogon events 5827 to 5829 and patch level.

Why does 4742 occur every 30 days for each computer?

Computers change their own password on a default schedule of 30 days. The subject is the computer account and only PasswordLastSet has a value.

Does 4742 show resource-based constrained delegation?

No. The msDS-AllowedToActOnBehalfOfOtherIdentity attribute is not part of the event. Use 5136 with a SACL on computer objects to detect changes to it.

Techniques follow MITRE ATT&CK® v20.1. © 2026 The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation (license). Field names were checked against Microsoft documentation and provider schemas.