1. Resources
  2. Detection sources
  3. Event ID 5139

Event ID 5139: A directory service object was moved

Written by a domain controller when an Active Directory object is moved into a container whose SACL audits creation of its class. Gives the old and new DN; the object's GUID ties the move to its 5136, 5137 and 5141 events.

Log source
Windows Security log
Detection value
Context
Volume
Low (estimate)
Last updated
Audit subcategory
Audit Directory Service Changes (DS Access, Success)
Logged on
Domain controllers only
Event versions
0
Detects
Not read by our detection rules yet

When it is written

A domain controller writes 5139 when an object is moved to another container in Active Directory, if Audit Directory Service Changes is on and the destination container has an auditing entry for the Create action on the object's class. Microsoft's example is a Create Computer objects entry on an organizational unit. Microsoft ties the event to the destination's SACL only, so a move into a container without such an entry writes no 5139, however closely the container the object left is audited. Only successful moves are logged: the subcategory has no failure events.

The event names the object by its old and new distinguished names, its GUID and its class. The GUID never changes, so it links the move with the object's earlier and later 5136, 5137 and 5141 events, whose distinguished name changes with the move. The other events of the same LDAP operation share its Correlation ID.

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
Microsoft's recommendation per computer role
ComputerAuditNote
Domain controllersSuccessMicrosoft 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 serversNot loggedMicrosoft says the subcategory makes sense only on domain controllers.
WorkstationsNot loggedMicrosoft says the subcategory makes sense only on domain controllers.
Check the current setting
auditpol /get /subcategory:"Directory Service Changes"
Based on vendor documentation.
Turn it on (local policy; a domain GPO overrides it)
auditpol /set /subcategory:"Directory Service Changes" /success:enable
Based on vendor documentation.
The same on a Windows in another display language
auditpol /get /subcategory:"{0CCE923C-69AE-11D9-BED3-505054503030}"
Based on vendor documentation.

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

5139 needs an auditing entry for Create on the destination container, for the class of the object being moved, and Audit Directory Service Changes (Success) on every domain controller. On each OU or container you want to watch, add a Success entry for Everyone for Create User objects, Create Computer objects, Create Group objects (or the classes you need), applied to this object, or to this object and all descendant objects to cover the OUs below it. Microsoft names only the destination's SACL: an entry on the container the object leaves does not produce the event.

Fields

In Event Viewer order. The field names are those of the event XML, from the event template that ships with Windows.

FieldWhat it holdsSince
Security IDSubjectUserSidSubjectSID of the account that moved the object. Event Viewer resolves it to a name.v0
Account NameSubjectUserNameSubjectName of the account that moved the object. Computer accounts end with $.v0
Account DomainSubjectDomainNameSubjectDomain of the account that moved the object, usually as a NetBIOS name.v0
Logon IDSubjectLogonIdSubjectLogon ID of the session that moved the object, in hexadecimal. Matches the 4624 event of that session on this domain controller, which holds the client address.v0
NameDSNameDirectory ServiceName of the Active Directory domain in which the object was moved, as a DNS name.v0
TypeDSTypeDirectory ServiceDirectory service type. %%14676 (Active Directory Domain Services) on domain controllers.v0
Old DNOldObjectDNObjectDistinguished name of the object before the move. Everything after its first component is the container it left.v0
New DNNewObjectDNObjectDistinguished name of the object after the move. Everything after its first component is the container it was moved to, the one whose SACL made the event.v0
GUIDObjectGUIDObjectobjectGUID of the object, in braces. It never changes, so it identifies the object in its 5136, 5137 and 5141 events before and after the move. Event Viewer resolves it to the object.v0
ClassObjectClassObjectClass of the object that was moved, for example user, computer, group, organizationalUnit or container.v0
Correlation IDOpCorrelationIDOperationCorrelation ID shared by every event of the same LDAP operation, in braces. Microsoft points to it for finding the other events of the operation, such as 5137 and 5141.v0
Application Correlation IDAppCorrelationIDOperationApplication Correlation ID. Microsoft says it is not in use and always holds a dash.v0

Values to know

Class ObjectClass

ValueMeaningSignal
user or computerAn account moved to another OUThe Group Policy objects linked to the new OU and the permissions delegated on it now apply to the account.Worth knowing
groupA group moved to another OUPermissions delegated on the new OU that are set to apply to its contents now apply to the group.Worth knowing
organizationalUnitAn OU moved with its contentsChanges the Group Policy and delegation that reach everything below it.Worth knowing

New DN NewObjectDN

ValueMeaningSignal
Ends with OU=Domain Controllers,DC=...An object moved into the Domain Controllers OUThe default location of domain controller computer accounts. Group Policy objects linked to that OU apply to any computer moved into it.Worth knowing
Any OU that holds privileged accounts or serversA move into a protected locationMicrosoft's advice is to audit and watch moves of specific classes into such locations.Worth knowing

Old DN OldObjectDN

ValueMeaningSignal
Contains CN=Users or CN=ComputersAn object leaving a default containerMicrosoft recommends moving users and computers from the default containers into OUs, since Group Policy cannot be linked to those containers.Expected

Volume and noise

Microsoft rates Audit Directory Service Changes high on domain controllers; for 5139 the volume is the moves into the containers your SACLs audit, usually few. Expect reorganizations, accounts created in one place and moved to their final OU, and computers and users moved out of the default Computers and Users containers, which Microsoft recommends so that Group Policy and delegated administration can apply to them.

Keeping it manageable

  • Audit only the moves that matter. Microsoft says there is no reason to audit every move of every object: pick the important locations (for example the OUs that hold administrative accounts, Tier 0 servers and the Domain Controllers OU) and audit the creation of the classes you care about there (user, computer, group).
  • The same Create entry also makes the domain controller write 5137 for objects created in that container, so containers you already audit for the library's 5137 rules (DNS zones, the Sites container, Public Key Services) log moves of the same classes into them too.
  • Follow an object by ObjectGUID, not by its distinguished name: after a move, the 5136 and 5141 events of the same object carry the new name.
  • Join it to 4624 through SubjectLogonId on the same domain controller to find where the session that moved the object came from.

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>5139</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">{5a7c2e91-4d3b-4f86-b0a2-8e1d6c9f3b47}</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="OldObjectDN">CN=SRV07,CN=Computers,DC=corp,DC=example,DC=com</Data>
    <Data Name="NewObjectDN">CN=SRV07,OU=Servers,DC=corp,DC=example,DC=com</Data>
    <Data Name="ObjectGUID">{2f8d4b6a-1c3e-4a57-9d0b-7e6f5a4c3b21}</Data>
    <Data Name="ObjectClass">computer</Data>
  </EventData>
</Event>

Attacks this event reveals

No detection rule or detection logic in our library reads this event yet. It is documented here because it sits next to the events they read: it explains them, follows from them or is the trace a defender looks for around them (see Related events).

Frequently asked questions

Why is there no 5139 when an object left an audited OU?

Microsoft writes the event only when the destination container has an auditing entry for creating objects of that class. An entry on the container the object leaves does not count, so moves out of an audited OU into one without such an entry go unrecorded. Audit Create on the places objects should not be moved into.

How do I follow an object after it was moved?

By its GUID. The ObjectGUID of 5139 never changes, while the distinguished name in the object's 5136 and 5141 events changes with the move. Use the old and new names of 5139 to read the events of each period.

Why does it matter which OU an object is in?

The OU decides which Group Policy objects apply to a user or computer, since Group Policy linked to an OU applies to the objects in it, and which delegated permissions it inherits, since permissions delegated on an OU can be made to apply to everything placed below it. Moving an object changes both, which is why Microsoft suggests watching moves of specific classes into your most important locations.

References