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

Event ID 4781: The name of an account was changed

Written when the logon name (sAMAccountName) of a user, computer or group changes: for domain accounts on domain controllers, for local ones on member servers and workstations. Shows the old and the new name.

Log source
Windows Security log
Detection value
High
Volume
Low
Last updated
Audit subcategory
Audit User Account Management (Account Management, Success)
Logged on
All Windows computers
Event versions
0
Detects
2 attacks (2 rules · 1 detection logic)
MITRE ATT&CK
2 techniques in 3 tactics
Threat groups
8 groups that MITRE ATT&CK records using these techniques
Fields the rules read
OldTargetUserNameNewTargetUserName

When it is written

Windows writes 4781 each time the account name (the sAMAccountName attribute) of an account changes, with the old and the new name. For user accounts, domain controllers write it for domain accounts and member servers and workstations for their local accounts. For computer accounts, only domain controllers write it. Microsoft's page for group changes (4735) adds that renaming a group also writes 4781 when Success auditing of this subcategory is on, so group renames appear here too. 4781 belongs to Audit User Account Management for every account type: Microsoft's subcategory page names it among the events that are also generated for computer accounts, so Audit Computer Account Management alone does not record computer renames.

Only the logon name counts. A new display name or user principal name is an attribute change, written as 4738 for users and 4742 for computers. Those events, and the group change events (4735, 4737, 4755), also carry the new name in their SAM Account Name field when the logon name changes.

How to turn it on

Advanced audit policy subcategory Audit User Account Management, 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 > Account Management > Audit User Account Management
Microsoft's recommendation per computer role
ComputerAuditNote
Domain controllersSuccess and FailureMicrosoft's general and stronger baselines both recommend Success and Failure auditing. Microsoft calls the subcategory useful for watching critical domain accounts (domain admins, service accounts, database admins) and recommends Failure auditing mainly for invalid password change and reset attempts on domain accounts, failed changes of the DSRM password and failed SID History additions.
Member serversSuccess and FailureBoth baselines recommend Success and Failure auditing. Microsoft recommends watching every change to local user accounts, especially the built-in local Administrator and other critical accounts, and Failure auditing mainly for invalid password change and reset attempts on local accounts.
WorkstationsSuccess and FailureBoth baselines recommend Success and Failure auditing. Microsoft recommends watching every change to local user accounts, especially the built-in local Administrator and other critical accounts, and Failure auditing mainly for invalid password change and reset attempts on local accounts.
Check the current setting
auditpol /get /subcategory:"User Account Management"
Based on vendor documentation.
Turn it on (local policy; a domain GPO overrides it)
auditpol /set /subcategory:"User Account Management" /success:enable
Based on vendor documentation.
The same on a Windows in another display language
auditpol /get /subcategory:"{0CCE9235-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

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 made the change. Event Viewer resolves it to a name when it can.v0
Account NameSubjectUserNameSubjectName of the account that made the change.v0
Account DomainSubjectDomainNameSubjectDomain of that account, or the computer name for a local account. NT AUTHORITY for well-known principals such as LOCAL SERVICE.v0
Logon IDSubjectLogonIdSubjectLogon ID of the session that made the change, in hexadecimal. The logon event of that session (4624) on the same computer carries the same value.v0
Security IDTargetSidTarget AccountSID of the renamed account. It does not change with the name, so it ties the old and the new name together. Event Viewer resolves it to the current name.v0
Account DomainTargetDomainNameTarget AccountDomain of the renamed account, as a NetBIOS or DNS name. For a local account, the name of the computer it belongs to.v0
Old Account NameOldTargetUserNameTarget AccountRead by 1 ruleThe account name before the change. Computer account names end with $.v0
New Account NameNewTargetUserNameTarget AccountRead by 2 rulesThe account name after the change.v0
PrivilegesPrivilegeListAdditional InformationPrivileges used for the operation, such as SeBackupPrivilege. A dash when none were captured, as in Microsoft's sample event; Microsoft says only that the list might not be captured.v0

Values to know

New Account Name NewTargetUserName

ValueMeaningSignal
No trailing $ while the old name had oneA computer account renamed to a user-style nameThe first step of sAMAccountName spoofing (CVE-2021-42278). Since the November 9, 2021 updates (KB5008102), domain controllers refuse this for requesters without administrator rights over computer accounts and log event 16991 in the System log instead.Attack signal
The name of a domain controller without $A name that collides with a domain controllerIn sAMAccountName spoofing the renamed account carries a domain controller's name for a short time.Attack signal
ESX AdminsA group renamed to the name ESXi hosts trustMicrosoft reports that domain-joined ESXi hosts without VMware's fix give full administrative access to members of a domain group with this name, matched by name and not by SID (CVE-2024-37085), and lists renaming an existing group as one way to exploit it. The group keeps its members through the rename, so they gain the access with no member-added event.Attack signal
Any other nameAn ordinary renameExpected

Old Account Name OldTargetUserName

ValueMeaningSignal
Ends with $A computer account was renamedOrdinary when a domain-joined machine is renamed and the new name also ends with $.Worth knowing
Any other nameA user or group was renamedExpected

Volume and noise

Microsoft rates the volume of the subcategory as low, and renames are rare: users whose name changes, corrections to naming conventions, renamed computers and groups. On domain controllers, computer renames follow the renaming of domain-joined machines.

Keeping it manageable

  • Keep every 4781: renames are rare and two rules read the old and new names.
  • Microsoft recommends watching every 4781 for high-value user and computer accounts and for local user accounts that matter, by TargetSid.
  • A computer account renamed to a name without the trailing $ has no ordinary reason; alert on it everywhere. Exclude only documented user accounts whose names end with $, by TargetSid.
  • Compare new names with the names of your domain controllers without the $ and with group names that grant privileges elsewhere, such as ESX Admins.
  • For the ESX Admins rule, look at domain controller events: Microsoft describes the group that domain-joined ESXi hosts trust as a domain group, so a local group renamed on a member server is not the case it describes.

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>4781</EventID>
    <Version>0</Version>
    <Level>0</Level>
    <Task>13824</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="OldTargetUserName">newhire07</Data>
    <Data Name="NewTargetUserName">bob</Data>
    <Data Name="TargetDomainName">CORP</Data>
    <Data Name="TargetSid">S-1-5-21-1004336348-1177238915-682003330-1121</Data>
    <Data Name="SubjectUserSid">S-1-5-21-1004336348-1177238915-682003330-1104</Data>
    <Data Name="SubjectUserName">adm-alice</Data>
    <Data Name="SubjectDomainName">CORP</Data>
    <Data Name="SubjectLogonId">0x3a7f21</Data>
    <Data Name="PrivilegeList">-</Data>
  </EventData>
</Event>

Attacks this event reveals

Detection rules that read this event:

Frequently asked questions

Does 4781 cover group renames?

Yes. Microsoft's page for 4735 says that renaming a group writes 4781 when Success auditing of Audit User Account Management is on, next to the group change event (4735, 4737 or 4755) that carries the new name.

Why does a computer account renamed without its trailing $ matter?

Computer account names end with $. Removing it is the first step of sAMAccountName spoofing (CVE-2021-42278), where the account takes a domain controller's name so that the KDC confuses the two. KB5008102 makes domain controllers refuse such names for requesters without administrator rights over computer accounts, so on updated domain controllers a 4781 of this kind was made by someone with those rights.

Are renames of local accounts logged?

Yes, on the computer that holds the account: member servers and workstations write 4781 for their local user accounts. Renaming a computer account is written only by domain controllers.

References