When it is written
Windows writes 4657 when a process creates, changes or deletes a registry value under a key whose system access control list (SACL) audits Set Value for the account doing it, and Audit Registry is on for Success. Microsoft notes that it is written for values only: a change to the key itself does not write it. Without a matching SACL entry nothing is logged, whatever the audit policy says.
The event is written on the computer whose registry changed. It names the account, the process (Process Name), the key and the value, and gives the data type and data before and after the change, so a single event shows what a setting was and what it became.
How to turn it on
Advanced audit policy subcategory Audit Registry, 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 > Object Access > Audit Registry| Computer | Audit | Note |
|---|---|---|
| Domain controllers | Success if needed and Failure if needed | Microsoft recommends Success and Failure only if needed, in both baselines. Plan a registry monitoring policy and the SACLs per role first, do not turn the subcategory on without that plan, remove SACLs that serve no purpose, and start with critical computers. Failure events show attempts to access a key that were refused. |
| Member servers | Success if needed and Failure if needed | Microsoft recommends Success and Failure only if needed, in both baselines. |
| Workstations | Success if needed and Failure if needed | Microsoft recommends Success and Failure only if needed, in both baselines. |
auditpol /get /subcategory:"Registry"auditpol /set /subcategory:"Registry" /success:enableauditpol /get /subcategory:"{0CCE921E-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
Audit Registry alone writes nothing. Microsoft says 4657 is generated only when Set Value auditing is in the SACL of the registry key. On every domain controller, add an auditing entry for Everyone, type Success, access Set Value, in the key's Permissions dialog (Advanced, Auditing) on these keys:
HKLM\System\CurrentControlSet\Control\Lsa, forDsrmAdminLogonBehavior.HKLM\SYSTEM\CurrentControlSet\Services\Kdc, forStrongCertificateBindingEnforcement,CertificateBackdatingCompensationandAllowNtAuthPolicyBypass.HKLM\System\CurrentControlSet\Control\SecurityProviders\Schannel, forCertificateMappingMethods.
The SACL is part of the key on each computer, so check that it is present on every domain controller, including new ones. A later change to it, such as the removal of the entry, is recorded by event 4907 when Audit Audit Policy Change is on.
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 changed the value. Event Viewer shows it resolved to an account name when it can. A change made by a process running as Local System shows S-1-5-18. | v0 |
Account NameSubjectUserNameSubject | Name of that account. For a process running as Local System it is the computer account, a name that ends with $. | v0 |
Account DomainSubjectDomainNameSubject | Domain of the account, usually as a NetBIOS name, the computer name for a local account, or NT AUTHORITY for well-known principals such as LOCAL SERVICE. | v0 |
Logon IDSubjectLogonIdSubject | Hexadecimal ID of the logon session that made the change. It matches the Logon ID of the 4624 logon event on the same computer, which tells how and from where the account logged on. | v0 |
Object NameObjectNameObject | Full path of the key that holds the value, in the kernel's form. HKEY_LOCAL_MACHINE appears as \REGISTRY\MACHINE and a user's hive as \REGISTRY\USER\ followed by the user's SID. Microsoft's table maps HKEY_CURRENT_CONFIG to a path under ControlSet001 and its sample of event 4907 names a key under \REGISTRY\MACHINE\SYSTEM\ControlSet001, so expect resolved control set names and match key paths on their end rather than on CurrentControlSet. | v0 |
Object Value NameObjectValueNameObjectRead by 2 rules | Name of the value that was created, changed or deleted. The rules match it exactly. | v0 |
Handle IDHandleIdObject | Hexadecimal handle the process used to open the key. It links this event to the 4656 and 4663 events of the same handle. 0x0 when it was not captured. | v0 |
Operation TypeOperationTypeObject | What happened to the value, as a message code. %%1904 a new value was created, %%1905 an existing value was modified, %%1906 the value was deleted. | v0 |
Process IDProcessIdProcess Information | Hexadecimal ID of the process that made the change. It matches New Process ID in the 4688 event that started that process. Process IDs are reused, so match within a short time on the same computer. | v0 |
Process NameProcessNameProcess Information | Full path of the executable of that process. | v0 |
Old Value TypeOldValueTypeChange Information | Data type of the value before the change, as a message code, for example %%1873 (REG_SZ), %%1874 (REG_EXPAND_SZ), %%1875 (REG_BINARY), %%1876 (REG_DWORD), %%1879 (REG_MULTI_SZ) or %%1883 (REG_QWORD). | v0 |
Old ValueOldValueChange Information | Data of the value before the change. Empty when there was none. | v0 |
New Value TypeNewValueTypeChange Information | Data type of the value after the change, with the same codes as the old type. | v0 |
New ValueNewValueChange Information | Data of the value after the change. Compare it with the old data to tell a change that lowers a protection from one that raises it. | v0 |
Values to know
Object Value Name ObjectValueName
| Value | Meaning | Signal |
|---|---|---|
DsrmAdminLogonBehavior | When the local DSRM administrator of a domain controller may log on (Lsa key)Microsoft documents 0 (only in Directory Services Restore Mode, the default in its guide), 1 (also while AD DS is stopped) and 2 (at any time). It does not recommend 2, because the DSRM password is not checked against any password policy. With 2, the DSRM account can log on to the domain controller at any time, while the directory runs. | Attack signal |
StrongCertificateBindingEnforcement | Strong certificate mapping check of the KDC (Kdc key)0 disables the check, 1 is compatibility mode, 2 is enforcement. Windows updates from April 11, 2023 ignore 0, and Microsoft ended support for the value with the September 9, 2025 security update, so on updated domain controllers a write shows intent more than effect. | Attack signal |
CertificateBackdatingCompensation | Time the KDC tolerates between a certificate's issue date and the account's creation (Kdc key)Only has an effect in compatibility mode, which Microsoft no longer supports after the September 2025 updates. | Attack signal |
AllowNtAuthPolicyBypass | NTAuth store check of the KDC for certificate logons (Kdc key)0 disables the check, 1 only logs, 2 enforces. Updates released in or after July 2025 enforce by default and remove the option to disable the check, and Microsoft discontinued support for the value with updates released in or after October 2025. | Attack signal |
CertificateMappingMethods | Certificate mapping methods Schannel accepts (Schannel key)The default is 0x18 (the two strong methods). Adding 0x1, 0x2 or 0x4 (for example 0x1F) turns the weak subject, issuer and UPN mappings back on. KB5014754 states no end of support for this value. | Attack signal |
Operation Type OperationType
| Value | Meaning | Signal |
|---|---|---|
%%1905 | Existing registry value modifiedThe usual operation. | Expected |
%%1904 | New registry value createdThe rules match it like a change. The watched values often do not exist until someone sets them. | Worth knowing |
%%1906 | Registry value deletedThe rules match it as well. Removing one of these values returns the setting to its default. | Worth knowing |
Process Name ProcessName
| Value | Meaning | Signal |
|---|---|---|
A program under System32 or Program Files | An ordinary Windows or management program made the change | Expected |
A program in another folder | For example a user profile or a temporary folderMicrosoft recommends watching for processes outside the standard folders. | Attack signal |
Volume and noise
The volume depends entirely on the SACLs you set: Microsoft rates the subcategory Low to Medium for that reason. A SACL that audits Set Value on a few configuration keys that rarely change produces a handful of events; auditing busy keys, or all keys through a global SACL, can flood the log. Microsoft asks for a registry monitoring plan before the subcategory is turned on, and for SACLs that serve no purpose to be removed.
Under the keys the rules watch, expected changes are the ones administrators and configuration tools make on purpose, for example a baseline that sets the certificate mapping values during a planned rollout.
Keeping it manageable
- Audit only Set Value, for Success, on the three keys listed under How to turn it on, and apply the entry to the key itself rather than to its whole subtree. Every extra access right or subkey adds events no rule reads.
- Do not use the Registry setting of Global Object Access Auditing for this: Microsoft describes it as one SACL applied to every registry key of the computer.
- If the same keys are audited for other reasons, keep only the values the rules read (
DsrmAdminLogonBehavior,StrongCertificateBindingEnforcement,CertificateBackdatingCompensation,AllowNtAuthPolicyBypass,CertificateMappingMethods) and compareObjectValueNamewithout regard to case: a value name keeps the capitals it was created with, and Microsoft's own guide spells the first oneDSRMAdminLogonBehavior. - Do not filter on
OperationType: the rules also match a value that is created (it often does not exist until someone sets it) and a value that is deleted.
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>4657</EventID>
<Version>0</Version>
<Level>0</Level>
<Task>12801</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="SubjectUserSid">S-1-5-21-1004336348-1177238915-682003330-1104</Data>
<Data Name="SubjectUserName">alice</Data>
<Data Name="SubjectDomainName">CORP</Data>
<Data Name="SubjectLogonId">0x5d3a41</Data>
<Data Name="ObjectName">\REGISTRY\MACHINE\SYSTEM\ControlSet001\Control\Lsa</Data>
<Data Name="ObjectValueName">DsrmAdminLogonBehavior</Data>
<Data Name="HandleId">0x2d4</Data>
<Data Name="OperationType">%%1905</Data>
<Data Name="OldValueType">%%1876</Data>
<Data Name="OldValue">0</Data>
<Data Name="NewValueType">%%1876</Data>
<Data Name="NewValue">2</Data>
<Data Name="ProcessId">0x1a2c</Data>
<Data Name="ProcessName">C:\Windows\regedit.exe</Data>
</EventData>
</Event>Attacks this event reveals
Detection rules that read this event:
Frequently asked questions
Why is no 4657 written although Audit Registry is enabled?
Because the subcategory only audits keys that have a SACL. Microsoft says 4657 is generated only when Set Value auditing is in the key's SACL. Add an auditing entry for Set Value on each key you want to watch, on every computer where it matters.
Which registry changes does the detection library watch with 4657?
Changes to DsrmAdminLogonBehavior under the Lsa key, which decides whether the DSRM administrator can log on to a running domain controller, and to the certificate mapping values StrongCertificateBindingEnforcement, CertificateBackdatingCompensation and AllowNtAuthPolicyBypass under the Kdc service key and CertificateMappingMethods under the Schannel key.
Does 4657 show the old and the new value?
Yes. OldValueType and OldValue hold the type and data before the change, NewValueType and NewValue after it, and OperationType says whether the value was created, modified or deleted.
Is creating or deleting a registry key logged as 4657?
No. Microsoft says 4657 is written for registry values, not for keys. Other events of the same subcategory cover access to keys (4656, 4663) and deleted objects (4660) when the SACL matches, and Microsoft notes that creating a subkey is not always logged.
References
- 4657(S): A registry value was modified (Microsoft)
- Audit Registry (Microsoft)
- 4907(S): Auditing settings on object were changed (Microsoft)
- Policy CSP: Audit, ObjectAccess_AuditRegistry (Microsoft)
- Advanced Audit Policy Configuration, Global Object Access Auditing (Microsoft)
- Restartable AD DS step-by-step guide, DSRMAdminLogonBehavior (Microsoft)
- KB5014754: Certificate-based authentication changes on Windows domain controllers (Microsoft)
- Protections for CVE-2025-26647 (Kerberos authentication) (Microsoft)