When it is written
A domain controller writes 5141 when an object is deleted and the deleted object itself has an auditing entry for the Delete action (Microsoft's event page). Microsoft's AD DS auditing guide, written for Windows Server 2008, lists two more entries that trigger the event: Delete child objects on the parent of the deleted object, and Delete subtree on the root of a subtree deletion. The event page says the event is generated only with the first, so put Delete on the objects themselves and do not count on the other two alone. Only successful deletions are logged, by the domain controller that performed them.
Tree Delete (TreeDelete) says whether the deletion used the Delete Subtree server control, which removes a container together with everything under it. Microsoft's guide adds that an object removed as part of such a deletion is audited only if it carries a Delete entry of its own: the entry on the root does not cover the objects under it, so one event with Tree Delete set to Yes can stand for many deleted objects. A deleted object moves to the Deleted Objects container: Microsoft notes that Event Viewer then resolves the event's GUID to that new location, and while the object is kept there it can be restored, which is logged as 5138 when the container it is restored to audits Create.
How to turn it on
Advanced audit policy subcategory Audit Directory Service Changes, 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 > DS Access > Audit Directory Service Changes| Computer | Audit | Note |
|---|---|---|
| Domain controllers | Success | Microsoft recommends Success auditing in both its general and stronger baselines, with SACLs designed for the important objects, classes and operations (it names changes to AdminSDHolder and the Domain Admins group). The subcategory has no failure events; failed access attempts are logged by Audit Directory Service Access. |
| 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 Changes"auditpol /set /subcategory:"Directory Service Changes" /success:enableauditpol /get /subcategory:"{0CCE923C-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
Microsoft's event page states that 5141 is generated only if the deleted object has an auditing entry for the Delete action, so the entry should reach the objects themselves, not only their container. Microsoft's AD DS auditing guide also lists Delete child objects on the parent and Delete subtree on the root of a subtree deletion as triggers; the entries below work under both readings. Audit Directory Service Changes (Success) must be on for every domain controller. For the rules on this page:
- Group Policy objects: on
CN=Policies,CN=System, Delete and Delete subtree for descendant groupPolicyContainer objects. - Domain controller registrations: on
CN=Sitesin the Configuration partition, Delete for descendant nTDSDSA objects. - DNS names: on each AD-integrated zone you watch, Delete for descendant dnsNode objects.
The default SACL of the domain object (the Windows Server 2003 and later default in Microsoft's schema reference) does not audit deletion. Microsoft's Defender for Identity setup does: its entries for descendant user, group, computer and managed service account objects select Full control minus the read permissions, which includes Delete and Delete subtree, so deletions of those accounts are logged in a domain configured that way. With the object types Microsoft lists, it puts no Delete entry on Group Policy objects, domain controller registrations or DNS names.
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 deleted the object. Event Viewer resolves it to a name. | v0 |
Account NameSubjectUserNameSubject | Name of the account that deleted the object. Computer accounts end with $. | v0 |
Account DomainSubjectDomainNameSubject | Domain of the account that deleted the object, usually as a NetBIOS name. | v0 |
Logon IDSubjectLogonIdSubject | Logon ID of the session that deleted the object, in hexadecimal. Matches the 4624 event of that session on this domain controller. | v0 |
NameDSNameDirectory Service | Name of the Active Directory domain in which the object was deleted, as a DNS name. | v0 |
TypeDSTypeDirectory Service | Directory service type. %%14676 (Active Directory Domain Services) on domain controllers. | v0 |
DNObjectDNObject | Distinguished name the object had before it was deleted. | v0 |
GUIDObjectGUIDObject | objectGUID of the deleted object, in braces. Event Viewer resolves it to the object's new place in Deleted Objects; use it to find the 5137 that created the object or the 5138 that restores it. | v0 |
ClassObjectClassObjectRead by 2 rules | Class of the deleted object, for example groupPolicyContainer, nTDSDSA, dnsNode, user or computer. | v0 |
Tree DeleteTreeDeleteOperation | Whether the Delete Subtree server control was used, as %%14678 (Yes) or %%14679 (No). | v0 |
Correlation IDOpCorrelationIDOperation | Correlation ID shared by every event of the same LDAP operation, in braces. | v0 |
Application Correlation IDAppCorrelationIDOperation | Application Correlation ID. Microsoft says it is not in use and always holds a dash. | v0 |
Values to know
Class ObjectClass
| Value | Meaning | Signal |
|---|---|---|
groupPolicyContainer | A Group Policy object was deletedThe settings the GPO applied stop being applied. Microsoft recommends monitoring GPO deletions. | Attack signal |
nTDSDSA | The NTDS Settings object of a domain controller was deletedExpected when a domain controller is demoted or its metadata is cleaned up. A deletion minutes after the 5137 that created it is what a temporary rogue domain controller (DCShadow) leaves. | Attack signal |
dnsNode | A name was removed from an AD-integrated DNS zoneUsually clean-up. Paired with a recent 5137 of the same object by a user account it is a short-lived name, which a hypothesis follows. | Worth knowing |
user, computer or group | An account or a group was deletedAlso logged as 4726, 4743 and the group deletion events without a SACL. Watch deletions of critical accounts, as Microsoft suggests. | Worth knowing |
Tree Delete TreeDelete
| Value | Meaning | Signal |
|---|---|---|
%%14678 | Yes: the Delete Subtree server control was usedThe container and everything under it are deleted in one operation. | Worth knowing |
%%14679 | No: an ordinary deletion | Expected |
Volume and noise
Lower than for changes: deletions are less frequent than attribute writes. The sources are account and computer clean-up, removal of stale DNS names in audited zones, and Group Policy housekeeping. Volume follows the Delete entries in your SACLs.
Keeping it manageable
- Keep every deletion of a
groupPolicyContaineror annTDSDSAobject: both are rare and both feed rules. - Audit Delete only on the objects that matter: GPOs, domain controller registrations, Tier 0 accounts and groups, and the DNS zones you watch for names that are created and removed again.
- Look at every event with
TreeDeleteset to Yes: Microsoft notes that a subtree deletion removes every object in the subtree, including objects protected from deletion, and the objects under the root get events of their own only where they carry a Delete entry themselves. - For DNS names, keep the deletions made by accounts that are not computer accounts: the hypothesis that follows short-lived names pairs a 5137 by a user account with a 5141 of the same object.
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>5141</EventID>
<Version>0</Version>
<Level>0</Level>
<Task>14081</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="OpCorrelationID">{f0b3d2a7-8e14-4c69-b1a5-73d9e2c4f816}</Data>
<Data Name="AppCorrelationID">-</Data>
<Data Name="SubjectUserSid">S-1-5-21-1004336348-1177238915-682003330-1105</Data>
<Data Name="SubjectUserName">alice</Data>
<Data Name="SubjectDomainName">CORP</Data>
<Data Name="SubjectLogonId">0x3e5a21</Data>
<Data Name="DSName">corp.example.com</Data>
<Data Name="DSType">%%14676</Data>
<Data Name="ObjectDN">CN=WS0099,OU=Workstations,DC=corp,DC=example,DC=com</Data>
<Data Name="ObjectGUID">{4b7e1d93-a2c5-4f80-9d36-e15b0c7a2f49}</Data>
<Data Name="ObjectClass">computer</Data>
<Data Name="TreeDelete">%%14679</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
Does the auditing entry for 5141 go on the deleted object or on its container?
On the object. Microsoft's event page states that the event is generated only if the deleted object has an auditing entry for the Delete action. Put the entry on the container with inheritance to the descendant objects of the class you watch, so that every object carries it. Microsoft's AD DS auditing guide for Windows Server 2008 also lists Delete child objects on the parent as a trigger, but the event page does not, so do not rely on that entry alone.
What does Tree Delete mean?
Yes means the Delete Subtree server control was used, for example by selecting Use Delete Subtree server control in Active Directory Users and Computers. The container is deleted with every object under it, including objects protected from accidental deletion. The objects under it get 5141 events of their own only where they carry a Delete entry themselves.
Can a deleted object come back?
Yes, while it is kept in the Deleted Objects container. A restore is logged as 5138 with the same ObjectGUID, provided the container the object is restored to audits Create.
References
- 5141(S): A directory service object was deleted (Microsoft)
- Audit Directory Service Changes (Microsoft)
- Active Directory Domain Services (AD DS) Auditing Step-by-Step Guide (Microsoft)
- 5138(S): A directory service object was undeleted (Microsoft)
- Domain-DNS class, default security descriptor (Microsoft)
- Configure Windows event auditing, Defender for Identity (Microsoft)
- 4662(S, F): An operation was performed on an object, access rights table (Microsoft)