When it is written
A domain controller writes 4742 when a computer account changes, one event for each change (Microsoft). Attributes that changed carry their new value and the others show a dash. A change to an attribute the event does not list, or to the account's permissions, still produces 4742, with every attribute shown as a dash: the event then says that something changed but not what. Microsoft adds that some changes write no 4742 at all, and gives a change on the Managed By tab of the computer account as its example. No SACL is needed.
Computers change their own accounts: Microsoft's Netlogon documentation says a computer tries to set the DNS host name and SPNs of its own account right after it joins a domain and again when its secure channel is established, and by default it changes its password every 30 days, so Subject and Computer Account That Was Changed are often the same account (Microsoft's event page names the restart after a domain join as the usual case). A join that reuses an existing computer account is different: Microsoft says the join then updates the account as needed (DNS host name and SPNs if not already set, the password, the disabled flag) with the credentials of the account doing the join, so expect that account as Subject. Microsoft also notes that if a user-type flag such as Smartcard Required is set on a computer account, the account becomes a user account type and later changes are logged as 4738 instead of 4742.
How to turn it on
Advanced audit policy subcategory Audit Computer Account Management, Success. Set it in a Group Policy object linked to the computers that write the event:
Computer Configuration > Policies > Windows Settings > Security Settings > Advanced Audit Policy Configuration > Audit Policies > Account Management > Audit Computer Account Management| Computer | Audit | Note |
|---|---|---|
| Domain controllers | Success | Microsoft recommends Success auditing in both its general and stronger baselines and monitoring changes to critical computer objects such as domain controllers, administrative workstations and critical servers, especially their deletion. The subcategory has no failure events. |
| Member servers | Not logged | Microsoft says the subcategory generates events only on domain controllers. |
| Workstations | Not logged | Microsoft says the subcategory generates events only on domain controllers. |
auditpol /get /subcategory:"Computer Account Management"auditpol /set /subcategory:"Computer Account Management" /success:enableauditpol /get /subcategory:"{0CCE9236-69AE-11D9-BED3-505054503030}"Run the commands in an elevated prompt on a computer that writes the event. Subcategory settings take effect only when the security option Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings is enabled (the default), and a Group Policy object that sets advanced audit policy replaces local changes at its next refresh. Microsoft's advanced audit policy reference
No SACL is needed: Audit Computer Account Management (Success) on every domain controller is enough. Microsoft's Advanced Audit Policy Configuration page lists Success as the default for this subcategory on server editions, but a Group Policy can change it, so check the setting with auditpol on each domain controller.
4742 covers a fixed set of attributes. Changes to others, such as msDS-AllowedToActOnBehalfOfOtherIdentity (resource-based delegation) or msDS-KeyCredentialLink, are not shown by 4742: Microsoft says a change to an attribute the event does not list usually writes a 4742 with every attribute a dash and that some changes write none, and does not say which applies to these two. To see them with their values you need 5136 and an auditing entry on the computer objects.
Fields
In Event Viewer order. The field names are those of the event XML, from the event template that ships with Windows.
| Field | What it holds | Since |
|---|---|---|
Security IDSubjectUserSidSubject | SID of the account that made the change. The same as TargetSid when the computer changed its own account. | v0 |
Account NameSubjectUserNameSubjectRead by 1 rule | Name of the account that made the change. A name ending with $ is a computer account; the DNS host name rule leaves those out. | v0 |
Account DomainSubjectDomainNameSubject | Domain of the account that made the change, usually as a NetBIOS name. | v0 |
Logon IDSubjectLogonIdSubject | Logon ID of the session that made the change, in hexadecimal. Matches the 4624 of that session on this domain controller. | v0 |
Security IDTargetSidComputer Account That Was Changed | SID of the changed account. Event Viewer resolves it to a name. | v0 |
Account NameTargetUserNameComputer Account That Was ChangedRead by 1 rule | Name of the changed computer account, ending with $. The Seamless SSO rule matches AZUREADSSOACC$ here. | v0 |
Account DomainTargetDomainNameComputer Account That Was Changed | Domain of the changed account, usually as a NetBIOS name. | v0 |
SAM Account NameSamAccountNameChanged Attributes | New sAMAccountName if it changed, otherwise a dash. | v0 |
Display NameDisplayNameChanged Attributes | New displayName if it changed. Usually not set on computers. | v0 |
User Principal NameUserPrincipalNameChanged AttributesRead by 1 rule | New userPrincipalName if it changed. Usually not set on computers, so a value here is unusual; one rule looks for any UPN written to a computer account. | v0 |
Home DirectoryHomeDirectoryChanged Attributes | New homeDirectory if it changed. Usually a dash for computers. | v0 |
Home DriveHomePathChanged Attributes | New Home Drive (homeDrive) if it changed. Usually a dash for computers. | v0 |
Script PathScriptPathChanged Attributes | New scriptPath (logon script) if it changed. Usually a dash for computers. | v0 |
Profile PathProfilePathChanged Attributes | New profilePath if it changed. Usually a dash for computers. | v0 |
User WorkstationsUserWorkstationsChanged Attributes | New userWorkstations if it changed. Usually a dash for computers. | v0 |
Password Last SetPasswordLastSetChanged Attributes | New pwdLastSet as a date and time when the password changed, by the computer itself (every 30 days by default) or by a reset. Microsoft suggests watching changes more frequent than usual. | v0 |
Account ExpiresAccountExpiresChanged Attributes | New accountExpires if it changed. Usually a dash for computers. | v0 |
Primary Group IDPrimaryGroupIdChanged AttributesRead by 2 rules | RID of the new primary group if it changed, for example 515 (Domain Computers), 516 (Domain Controllers) or 521 (Read-only Domain Controllers). | v0 |
AllowedToDelegateToChanged AttributesRead by 1 rule | The full new list of msDS-AllowedToDelegateTo services when it changed (not only the added ones), | v0 |
Old UAC ValueOldUacValueChanged Attributes | Account flags before the change, in hexadecimal, in the SAM encoding that Microsoft says differs from the userAccountControl attribute. | v0 |
New UAC ValueNewUacValueChanged Attributes | Account flags after the change, in the same encoding. | v0 |
User Account ControlUserAccountControlChanged AttributesRead by 6 rules | The flags that changed, one %% code per flag, for example %%2093 ('Trusted For Delegation' - Enabled). In the Windows message file codes from %%2080 mean a flag was set and codes from %%2048 to %%2079 that it was cleared. | v0 |
User ParametersUserParametersChanged Attributes | <value changed, but not displayed> when the dial-in settings changed, otherwise a dash. | v0 |
SID HistorySidHistoryChanged AttributesRead by 1 rule | New sIDHistory if it changed. Microsoft says it is always a dash unless the account was migrated from another domain. | v0 |
Logon HoursLogonHoursChanged Attributes | New logonHours if they changed. Usually a dash for computers. | v0 |
DNS Host NameDnsHostNameChanged AttributesRead by 1 rule | New dNSHostName if it changed. Normally written by the computer itself, or by the account doing the join when a join reuses an existing account; the DNS host name rule flags a change by any account that is not a computer. | v0 |
Service Principal NamesServicePrincipalNamesChanged AttributesRead by 1 rule | The full new list of SPNs when it changed (not only the added ones), separated by spaces in the XML; a dash when unchanged. | v0 |
PrivilegesPrivilegeListAdditional Information | Privileges used for the operation, or a dash when none was captured. | v0 |
ComputerAccountChange | Not shown in the event message and not described by Microsoft; its sample event has a dash. | v0 |
Values to know
User Account Control UserAccountControl
| Value | Meaning | Signal |
|---|---|---|
%%2088 | 'Server Trust Account' - EnabledTurns the account into a domain controller account. Expected only during a promotion; Microsoft says it should be enabled only for domain controllers. | Attack signal |
%%2093 | 'Trusted For Delegation' - EnabledUnconstrained delegation (trust for delegation to any service). Setting it takes the Enable computer and user accounts to be trusted for delegation user right (SeEnableDelegationPrivilege), which Microsoft lists for the Administrators group on domain controllers by default. Microsoft recommends checking every change of this flag on a computer account. | Attack signal |
%%2096 | 'Don't Require Preauth' - EnabledKerberos pre-authentication off. Microsoft says it should not be enabled for computer accounts. | Attack signal |
%%2082 | 'Password Not Required' - EnabledMicrosoft says it should not be set for computer accounts. | Attack signal |
%%2091 | 'Encrypted Text Password Allowed' - EnabledReversible password encryption. Microsoft says it should not be set for computer accounts. | Attack signal |
%%2062 | 'Not Delegated' - DisabledThe account is no longer protected from delegation. | Attack signal |
%%2098 | 'Trusted To Authenticate For Delegation' - EnabledProtocol transition for constrained delegation. Microsoft recommends checking every change of this flag. | Worth knowing |
%%2056 | 'Server Trust Account' - DisabledMicrosoft says it should not be disabled for domain controllers. Expected when a domain controller is demoted. | Worth knowing |
Service Principal Names ServicePrincipalNames
| Value | Meaning | Signal |
|---|---|---|
Contains E3514235-4B06-11D1-AB04-00C04FC2DCD2/ | The replication (DRS) SPN of a domain controllerStandard on every domain controller. Added to a computer account outside a promotion it is what registering a rogue domain controller needs. The field holds the full new list, not only the added SPN. | Attack signal |
HOST/ and RestrictedKrbHost/ names | The SPNs a computer registers for itselfWritten by the computer after a join or a rename; Microsoft's example also shows TERMSRV. | Expected |
Primary Group ID PrimaryGroupId
| Value | Meaning | Signal |
|---|---|---|
- | Not changed | Expected |
515 | Domain Computers | Expected |
516 or 521 | Domain Controllers or Read-only Domain ControllersExpected during a promotion. The privileged primary group rule includes 516. | Worth knowing |
512, 518, 519, 526 or 527 | Domain Admins, Schema Admins, Enterprise Admins, Key Admins or Enterprise Key AdminsA privileged primary group grants that group's rights without showing in its member list. | Attack signal |
SID History SidHistory
| Value | Meaning | Signal |
|---|---|---|
- or %%1793 | Not changed, or <value not set> | Expected |
Any SID | SID history writtenMicrosoft says the field is always a dash unless the account was migrated from another domain. Outside a migration project this is SID history injection. | Attack signal |
Volume and noise
Microsoft rates Audit Computer Account Management low on domain controllers. Most 4742 events are routine and made by the computer's own account (a name ending in $): password changes every 30 days by default, and DNS name and SPN updates after joins, renames and restarts. Administrative changes (delegation, moves between primary groups, SPNs registered for services) are far fewer.
Keeping it manageable
- Do not drop events made by computer accounts wholesale: the replication SPN, account flag, delegation and SID history rules read 4742 whoever made the change. The rules that need the change to come from a person (DNS host name) filter on the subject themselves.
- Expect the DNS host name rule to match domain joins that reuse an existing computer account: Microsoft says the join writes the DNS host name, when it is not already set, with the credentials of the account doing the join. Exclude your join and deployment accounts from that rule by
SubjectUserSid. - Keep password-only changes (every attribute a dash except Password Last Set) for domain controllers and Tier 0 servers at least: a hypothesis looks for a machine password that changes outside the normal 30-day cycle after a vulnerable Netlogon connection.
- Expect a change to
AZUREADSSOACC$each time you roll over the Seamless SSO Kerberos decryption key, which Microsoft recommends at least every 30 days. Record the rollovers so the alert can be closed against them. - A domain controller promotion produces 4742 with Server Trust Account enabled, primary group 516 and replication SPNs, which several rules flag. Match these to the planned promotion rather than excluding them.
Sample event
Version 0, with made-up values.
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Microsoft-Windows-Security-Auditing" Guid="{54849625-5478-4994-a5ba-3e3b0328c30d}" />
<EventID>4742</EventID>
<Version>0</Version>
<Level>0</Level>
<Task>13825</Task>
<Opcode>0</Opcode>
<Keywords>0x8020000000000000</Keywords>
<TimeCreated SystemTime="2026-11-18T09:30:12.4567890Z" />
<EventRecordID>1048576</EventRecordID>
<Correlation />
<Execution ProcessID="712" ThreadID="2408" />
<Channel>Security</Channel>
<Computer>DC01.corp.example.com</Computer>
<Security />
</System>
<EventData>
<Data Name="ComputerAccountChange">-</Data>
<Data Name="TargetUserName">WS0142$</Data>
<Data Name="TargetDomainName">CORP</Data>
<Data Name="TargetSid">S-1-5-21-1004336348-1177238915-682003330-2241</Data>
<Data Name="SubjectUserSid">S-1-5-21-1004336348-1177238915-682003330-2241</Data>
<Data Name="SubjectUserName">WS0142$</Data>
<Data Name="SubjectDomainName">CORP</Data>
<Data Name="SubjectLogonId">0x5c8e3a</Data>
<Data Name="PrivilegeList">-</Data>
<Data Name="SamAccountName">-</Data>
<Data Name="DisplayName">-</Data>
<Data Name="UserPrincipalName">-</Data>
<Data Name="HomeDirectory">-</Data>
<Data Name="HomePath">-</Data>
<Data Name="ScriptPath">-</Data>
<Data Name="ProfilePath">-</Data>
<Data Name="UserWorkstations">-</Data>
<Data Name="PasswordLastSet">-</Data>
<Data Name="AccountExpires">-</Data>
<Data Name="PrimaryGroupId">-</Data>
<Data Name="AllowedToDelegateTo">-</Data>
<Data Name="OldUacValue">-</Data>
<Data Name="NewUacValue">-</Data>
<Data Name="UserAccountControl">-</Data>
<Data Name="UserParameters">-</Data>
<Data Name="SidHistory">-</Data>
<Data Name="LogonHours">-</Data>
<Data Name="DnsHostName">WS0142.corp.example.com</Data>
<Data Name="ServicePrincipalNames">HOST/WS0142.corp.example.com RestrictedKrbHost/WS0142.corp.example.com HOST/WS0142 RestrictedKrbHost/WS0142 TERMSRV/WS0142.corp.example.com TERMSRV/WS0142</Data>
</EventData>
</Event>Attacks this event reveals
Detection rules that read this event:
Detection logic (hypotheses that join this event with others) for:
Frequently asked questions
Why are all the attributes a dash in some 4742 events?
Microsoft explains that the event is also written when an attribute it does not list changes, or when the account's permissions change, and then shows every attribute as a dash. To know which attribute changed you need 5136 with an auditing entry on the computer objects.
Which 4742 changes point to an attack?
Server Trust Account enabled outside a domain controller promotion, Trusted For Delegation enabled, Don't Require Preauth or Password Not Required enabled, Not Delegated disabled, a new constrained delegation list, the replication SPN (E3514235-4B06-11D1-AB04-00C04FC2DCD2/) on a non-domain controller, a privileged primary group, SID history written outside a migration, a DNS host name or UPN set by a person, and any change to AZUREADSSOACC$ that is not a planned key rollover.
Why does a computer account change itself?
Microsoft's Netlogon documentation says a computer tries to set the DNS host name and SPNs of its own account right after a domain join and again when its secure channel is established, and by default it changes its password every 30 days. Microsoft notes that Subject and the changed account are then the same, usually after the restart that follows a join.
Should I use 4742 or 5136 for computer account changes?
Both. 4742 needs no SACL and covers the account flags, delegation list, SPNs, primary group and SID history. 5136 needs an auditing entry but shows any attribute with old and new values, including resource-based delegation and key credentials, which 4742 does not list.
References
- 4742(S): A computer account was changed (Microsoft)
- Audit Computer Account Management (Microsoft)
- Advanced Audit Policy Configuration settings (Microsoft)
- How to configure SPN, the DRS replication SPN of domain controllers (Microsoft)
- Microsoft Entra seamless single sign-on FAQ, rolling over the AZUREADSSO key (Microsoft)
- Use the UserAccountControl flags to manipulate user account properties (Microsoft)
- Event IDs 5788 and 5789 occur on a Windows-based computer, when a computer updates its own DNS host name and SPNs (Microsoft)
- Active Directory domain join permissions (Microsoft)
- Enable computer and user accounts to be trusted for delegation (Microsoft)
- Configuring Kerberos delegation for group Managed Service Accounts, delegation types and account flags (Microsoft)
- Microsoft Entra seamless single sign-on: Technical deep dive, the AZUREADSSOACC computer account (Microsoft)