Skip to content

Windows Event ID 5138: A directory service object was undeleted

Written when a deleted Active Directory object is undeleted. It captures object revival from the AD Recycle Bin and the like.

Overview

The subcategory is Audit Directory Service Changes. It is generated when a deleted AD object is restored. It indicates a revival operation via the AD Recycle Bin feature and similar.

How it is triggered

  • Restoring a deleted object via the AD Recycle Bin or a tool.

Security review points

  • An attacker may revive a previously disabled/deleted privileged account or object to abuse it. Check the restored object (especially privileged accounts) and the restoring subject.
  • Paired with deletion 5141, track the delete-then-restore flow. Investigate unexpected restores.

Notes for log review

  • It is a rare operation. If the restored target is an important object (a privileged account, etc.), confirm it at high priority.
  • Separate legitimate recovery of an accidental deletion from an illicit revival, by the target and subject.

MITRE ATT&CK mapping

No technique maps directly. Reviving a deleted privileged account for use is reviewed from the T1078.002 Domain Accounts angle.

Mapping as of ATT&CK v19.2. To search by technique, see the ATT&CK reverse lookup.

Detection rules

Microsoft Sentinel has 1 public detection rule that uses this event ID as a condition.

RuleTypeSeverity
PROD (TM003.1) - OBJECT - Moved or Recovered a Tier Level AccountSentinel (needs setup)Medium

Rules are collected from SigmaHQ r2026-07-01 and from Azure-Sentinel as of 2026-10-09, limited to those whose conditions include this event ID. Sentinel rules are limited to those that query the SecurityEvent or WindowsEvent table. “Threat-specific” rules target a particular threat group or malware, and “needs setup” rules require values for your environment. Severity is the value each rule’s author assigned.

Key fields

FieldMeaning
Object DN / ClassThe restored object
Subject\Account NameThe subject that performed the restore

References