Tools / Event IDs / Event ID 4765

Event ID 4765: sid history added to an account

What Event ID 4765 (sid history added to an account) means, the fields to check, what is normal and what is suspicious, with PowerShell and KQL queries to find it.

Log: Security · Severity: High · MITRE ATT&CK T1134.005 · Updated 2026-11-08

Event ID 4765 says SID History was added to an account. SID History exists for domain migrations: it lets a moved account keep access to resources that still trust its old SID. Attackers like it for the same reason. If they add the SID of Domain Admins or Enterprise Admins to an ordinary user's SID History, that user quietly gets those rights without appearing in any admin group. Outside a migration project, a 4765 is close to proof of compromise.

The fields that matter

FieldWhat it tells you
Subject > Account NameWho added the SID History.
Target Account > Account NameThe account that received the extra SIDs.
Source Account > Account NameThe account the SID came from, during a real migration usually in the old domain.
Additional Information > SID ListThe SIDs added. A SID ending in -512 (Domain Admins), -519 (Enterprise Admins) or -544 (Administrators) is the worst case.

What is normal

Migrations with ADMT or a third-party migration tool, which add SID History for many accounts in a short window, run by the migration team, with old-domain SIDs.

When Event ID 4765 is suspicious

Common false positive: Domain migrations and mergers. Once the migration is finished, clean up SID History and turn on SID filtering on the trust, so any later 4765 is unambiguous.

Find Event ID 4765 with PowerShell

Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4765; StartTime=(Get-Date).AddDays(-7)} -MaxEvents 50 |
  ForEach-Object {
    $d = [ordered]@{ Time = $_.TimeCreated; Computer = $_.MachineName }
    ([xml]$_.ToXml()).Event.EventData.Data | ForEach-Object { $d[$_.Name] = $_.'#text' }
    [pscustomobject]$d
  } | Format-List

Microsoft Sentinel (KQL)

SecurityEvent
| where TimeGenerated > ago(7d) and EventID == 4765
| project TimeGenerated, Computer, Account, Activity, EventData
| order by TimeGenerated desc

Related events

FAQ

How do I find accounts that already have SID History?

Run Get-ADUser -Filter * -Properties SIDHistory | Where-Object SIDHistory (and the same with Get-ADGroup and Get-ADComputer). After a finished migration the list should be short, and none of the SIDs should belong to your own domain.

Does every SID History injection create Event ID 4765?

No. Mimikatz sid::add running against a DC is logged, but a change pushed through DCShadow skips the normal write path. Check accounts for SID History directly as well, and watch for 4928 and 4929.

What is the difference between 4765 and 4766?

4765 is a successful add; 4766 is a failed attempt. A 4766 still tells you someone tried, so treat it just as seriously.