When it is written
A domain controller writes 4662 when an operation on an Active Directory object matches an auditing entry in the object's SACL: reading or writing a property, using an extended right (Control Access) such as the replication rights, deleting the object or changing its permissions. Microsoft: one event is written for each type of operation performed, and a refused operation is a Failure event when the SACL audits failures.
In the event XML, Object Type and Object Name hold GUIDs written as %{...}: the schemaIDGUID of the object's class and the objectGUID of the object, as Microsoft's own sample event shows. Event Viewer can resolve them: in Microsoft's illustration of the same event its General tab shows the class name and the distinguished name, which is what Microsoft's field descriptions give. The XML, which the rules on this page read, keeps the GUIDs. Properties lists the access, then the GUIDs of the extended right, property set or attribute concerned and of the object's class. The event has no client address: the Logon ID leads to the 4624 of the same session on the same domain controller, which has it.
How to turn it on
Advanced audit policy subcategory Audit Directory Service Access, Success and Failure. 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 > DS Access > Audit Directory Service Access| Computer | Audit | Note |
|---|---|---|
| Domain controllers | Failure | Microsoft recommends Failure auditing only, in both its general and stronger baselines: it prefers Audit Directory Service Changes for tracking changes and uses this subcategory for failed access attempts, with SACLs limited to specific important objects, classes and operations. |
| Member servers | Not logged | Microsoft says the subcategory makes sense only on domain controllers. |
| Workstations | Not logged | Microsoft says the subcategory makes sense only on domain controllers. |
auditpol /get /subcategory:"Directory Service Access"auditpol /set /subcategory:"Directory Service Access" /success:enable /failure:enableauditpol /get /subcategory:"{0CCE923B-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
4662 needs Audit Directory Service Access on every domain controller and an auditing entry on the object that matches the operation. Microsoft's own recommendation for this subcategory is Failure only; the rules on this page read Success events, so turn on both. Microsoft's Advanced Audit Policy Configuration page lists Success as the default on server editions, but a GPO can change it: check with auditpol.
The auditing entries the rules need:
- Replication (DCSync): the default SACL of the domain object already audits the use of extended rights by Domain Users and Administrators. A request by an account in neither group, such as a computer account (domain controllers included), is not logged; the hypothesis that compares requesting computer accounts with your domain controllers needs an entry for Everyone, All extended rights, This object only, on the domain object.
- gMSA passwords: on the domain root (or the containers that hold gMSAs), a Success entry for Everyone, Read msDS-ManagedPassword, applied to descendant msDS-GroupManagedServiceAccount objects.
- KDS root keys: Microsoft suggests a SACL that audits successful reads on the Master Root Keys container (
CN=Master Root Keys,CN=Group Key Distribution Service,CN=Servicesin the Configuration partition), so that reads ofmsKds-RootKeyDataare logged. - Windows LAPS: the Set-LapsADAuditing cmdlet configures auditing of the LAPS password attributes on an OU, for the principals you name.
- AD FS keys: the entry Microsoft documents for Defender for Identity on the AD FS container (Program Data, Microsoft, ADFS): Everyone, type All, This object and all descendant objects, Read all properties and Write all properties.
Microsoft's Defender for Identity entries on the domain root audit writes only, so they do not produce the read and replication events above.
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 performed the operation. Event Viewer resolves it to a name. | v0 |
Account NameSubjectUserNameSubject Read by 6 rules | Name of the account that performed the operation. Computer accounts end with $; the rules leave them out. | v0 |
Account DomainSubjectDomainNameSubject | Domain of the account, usually as a NetBIOS name. | v0 |
Logon IDSubjectLogonIdSubject | Logon ID of the session, in hexadecimal. Microsoft names it as the value that links this event to the 4624 of the same session, which holds the client address that 4662 lacks. | v0 |
Object ServerObjectServerObject | Always DS for this event (Microsoft). | v0 |
Object TypeObjectTypeObjectRead by 2 rules | Class of the object as the schemaIDGUID of the class, written as %{GUID}, for example %{19195a5b-6da0-11d0-afd3-00c04fd930c9} for the domain object. Translate it by searching the schema for that schemaIDGUID. | v0 |
Object NameObjectNameObjectRead by 1 rule | The object as its objectGUID, written as %{GUID}, in the event XML. Microsoft's description calls this field the distinguished name, which is what Event Viewer shows in Microsoft's illustration of the event; search the directory for the objectGUID to find the object from the XML value. | v0 |
Handle IDHandleIdObject | Handle to the object, in hexadecimal. 0x0 when it was not captured, as in Microsoft's sample. | v0 |
Operation TypeOperationTypeOperation | Type of operation, typically Object Access. | v0 |
AccessesAccessListOperation | Access used, as %% codes from the Windows message file, for example %%7684 (Read Property), %%7685 (Write Property), %%7688 (Control Access), %%1537 (DELETE) or %%1539 (WRITE_DAC). | v0 |
Access MaskAccessMaskOperationRead by 3 rules | Access used as a hexadecimal mask, for example 0x10 (Read Property), 0x20 (Write Property), 0x100 (Control Access), 0x10000 (DELETE) or 0x40000 (WRITE_DAC). | v0 |
PropertiesOperationRead by 5 rules | The access again, followed by the GUIDs it applied to, each in braces, for example %%7688 {1131f6ad-9c07-11d1-f79f-00c04fc2dcd2} {19195a5b-6da0-11d0-afd3-00c04fd930c9}. GUIDs are extended rights, property sets, attributes and the class of the object. The rules search this field. | v0 |
Parameter 1AdditionalInfoAdditional Information | Parameter 1. Microsoft does not document it; its sample event shows a dash. | v0 |
Parameter 2AdditionalInfo2Additional Information | Parameter 2. Microsoft does not document it; empty in its sample event. | v0 |
Values to know
Access Mask AccessMask
| Value | Meaning | Signal |
|---|---|---|
0x100 | Control Access (an extended right was used)With a replication right in Properties it is a replication request; from an account that is not a domain controller that is DCSync. | Attack signal |
0x10 | Read PropertyThe gMSA password and AD FS key rules match reads of specific attributes. | Attack signal |
0x20 | Write PropertyThe same write appears with its value in 5136 when Audit Directory Service Changes is on. | Worth knowing |
0x40000 or 0x80000 | WRITE_DAC or WRITE_OWNERPermissions or owner changed. Microsoft lists both among the access types worth monitoring. | Worth knowing |
0x10000 | DELETEMicrosoft notes it is also logged when an object is moved. | Worth knowing |
Properties
| Value | Meaning | Signal |
|---|---|---|
1131f6aa-9c07-11d1-f79f-00c04fc2dcd2 | DS-Replication-Get-Changes (Replicating Directory Changes)Extended right to replicate changes from a naming context. Read by the DCSync rule. | Attack signal |
1131f6ad-9c07-11d1-f79f-00c04fc2dcd2 | DS-Replication-Get-Changes-All (Replicating Directory Changes All)Extended right to replicate secret domain data, password hashes included. Read by the DCSync rule. | Attack signal |
89e95b76-444d-4c62-991a-0facbeda640c | DS-Replication-Get-Changes-In-Filtered-SetThe third replication right. Read by the DCSync rule. | Attack signal |
e362ed86-b728-0842-b27d-2dea7a9df218 | msDS-ManagedPassword (the gMSA password blob)Read by a non-computer account is what the gMSA rule looks for; the hosts allowed to use a gMSA read it with their computer accounts. | Attack signal |
f3531ec6-6330-4f8e-8d39-7a671fbac605 | ms-LAPS-Encrypted-Password-Attributes (the Windows LAPS encrypted password property set)Read by a non-computer account, or by one account for many computers, is what the LAPS rules look for. | Attack signal |
8d3bca50-1d7e-11d0-a081-00aa006c33ed | thumbnailPhoto (Picture) attributeRead on a contact object (ObjectType 5cb41ed0-0e4c-11d0-a286-00aa003049e2) by an account that does not end with $ is what the AD FS DKM key rule looks for. The rule assumes the AD FS service runs as a gMSA; if it runs as a user account, exclude that account by SID. | Attack signal |
bf9679c0-0de6-11d0-a285-00aa003049e2 | member attributeRead on the administrative groups by an unexpected account is a hypothesis for group reconnaissance over LDAP; it needs its own auditing entry. | Worth knowing |
Object Type ObjectType
| Value | Meaning | Signal |
|---|---|---|
%{19195a5b-6da0-11d0-afd3-00c04fd930c9} | domainDNS (the domain object)Where replication rights are checked. | Expected |
%{aa02fd41-17e0-4f18-8687-b2239649736b} | msKds-ProvRootKey (a KDS root key)Any access by an account that is not a computer account matches the KDS root key rule. Microsoft's Golden gMSA guidance explains that gMSA passwords can be derived from these keys. | Attack signal |
%{5cb41ed0-0e4c-11d0-a286-00aa003049e2} | contactMatters together with a read of thumbnailPhoto in the AD FS container. | Worth knowing |
Account Name SubjectUserName
| Value | Meaning | Signal |
|---|---|---|
Ends with $ | A computer accountDomain controllers replicate and computers read the gMSA and LAPS attributes they are entitled to, which is why the rules leave computer accounts out. | Expected |
Starts with MSOL_ | The Microsoft Entra Connect connector account of an express installationRequests replication every two minutes for password hash synchronization. Microsoft describes the name only as prefixed with MSOL_. | Noise |
Volume and noise
Microsoft rates Audit Directory Service Access high on domain controllers. The volume of 4662 is set by your SACLs: an entry that audits reads on common objects logs a large share of ordinary LDAP queries, while entries limited to a few sensitive attributes stay quiet.
Out of the box the domain object's default SACL audits the use of extended rights by Domain Users and Administrators on that object, so replication requests from such accounts are logged. Microsoft Entra Connect is the usual one: with password hash synchronization its connector account requests password hashes over the replication protocol every two minutes, using both replication rights.
Keeping it manageable
- Exclude your Microsoft Entra Connect connector account from the DCSync rule by SID, not by name (Microsoft documents only that an express installation gives it a name prefixed with MSOL_, which a lookalike account can copy). Keep its events: a request by it from an address other than the Connect server's is still worth seeing through the 4624 of the session.
- Audit reads only where a rule needs them (the gMSA password attribute, the Windows LAPS attributes, the KDS root keys, the AD FS container); a read entry for Everyone on all objects would log a large share of ordinary LDAP queries.
- Keep Failure events: Microsoft recommends them for failed access attempts on directory objects, and a refused replication request or key read is worth seeing.
- If you must filter at collection, keep the events where
AccessMaskis0x100orPropertiesholds one of the GUIDs under the values worth knowing, and every event whoseObjectTypeis the KDS root key class (that rule matches any access to it).
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>4662</EventID>
<Version>0</Version>
<Level>0</Level>
<Task>14080</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-1130</Data>
<Data Name="SubjectUserName">MSOL_4f1c8a2e9b</Data>
<Data Name="SubjectDomainName">CORP</Data>
<Data Name="SubjectLogonId">0x5a3f2c1</Data>
<Data Name="ObjectServer">DS</Data>
<Data Name="ObjectType">%{19195a5b-6da0-11d0-afd3-00c04fd930c9}</Data>
<Data Name="ObjectName">%{0b4e7c2d-91a3-4f58-b6e2-7d3c1a9f5e08}</Data>
<Data Name="OperationType">Object Access</Data>
<Data Name="HandleId">0x0</Data>
<Data Name="AccessList">%%7688</Data>
<Data Name="AccessMask">0x100</Data>
<Data Name="Properties">%%7688 {1131f6ad-9c07-11d1-f79f-00c04fc2dcd2} {19195a5b-6da0-11d0-afd3-00c04fd930c9}</Data>
<Data Name="AdditionalInfo">-</Data>
<Data Name="AdditionalInfo2"></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
How do I detect DCSync with event 4662?
Look for AccessMask 0x100 (Control Access) on the domain object whose Properties hold 1131f6aa-9c07-11d1-f79f-00c04fc2dcd2, 1131f6ad-9c07-11d1-f79f-00c04fc2dcd2 or 89e95b76-444d-4c62-991a-0facbeda640c, from an account that is not a domain controller. Domain controller accounts end with $, and the Microsoft Entra Connect connector account replicates for password hash synchronization. 4662 has no source address; the Logon ID leads to the 4624 of the session, which has it.
Why does Object Name show a GUID instead of a name?
The event XML carries the objectGUID of the object, written as %{GUID}, and the schemaIDGUID of its class in Object Type, as Microsoft's sample shows. Event Viewer can resolve both, and in Microsoft's illustration of the same event its General tab shows the distinguished name and the class name; the XML, which the rules read, keeps the GUIDs. Search the directory for the objectGUID, and the schema for the schemaIDGUID, to name them.
Why is there no 4662 when a gMSA password or a LAPS password is read?
No default auditing entry covers those reads. Add a Read Property entry for msDS-ManagedPassword on the gMSA objects, and use Set-LapsADAuditing for the LAPS attributes, with Audit Directory Service Access (Success) on every domain controller.
Do I need 4662 if I already collect 5136?
Yes, for different things. 5136 shows successful writes with their old and new values. 4662 shows reads, the use of extended rights such as replication, and refused operations, none of which 5136 records.
References
- 4662(S, F): An operation was performed on an object (Microsoft)
- Audit Directory Service Access (Microsoft)
- Domain-DNS class, default security descriptor (Microsoft)
- DS-Replication-Get-Changes extended right (Microsoft)
- DS-Replication-Get-Changes-All extended right (Microsoft)
- DS-Replication-Get-Changes-In-Filtered-Set extended right (Microsoft)
- ms-DS-ManagedPassword attribute (Microsoft)
- ms-Kds-Prov-RootKey class (Microsoft)
- Picture (thumbnailPhoto) attribute (Microsoft)
- Contact class (Microsoft)
- Windows LAPS schema extensions and extended rights reference (Microsoft)
- Set-LapsADAuditing (Microsoft)
- How to recover from a Golden gMSA attack, auditing the KDS root key (Microsoft)
- Configure Windows event auditing, Defender for Identity (Microsoft)
- Password hash synchronization with Microsoft Entra Connect Sync (Microsoft)
- Microsoft Entra Connect: Accounts and permissions, the AD DS Connector account (Microsoft)
- Advanced Audit Policy Configuration settings (Microsoft)