When it is written
A domain controller writes 4794 each time an attempt is made to set the password of its Directory Services Restore Mode (DSRM) administrator. That account is the domain controller's own local administrator, used to sign in when the domain controller is started without Active Directory Domain Services. Its password is chosen when the server is promoted, and members of Domain Admins can reset it later, for the domain controller they work on or for another domain controller of the domain.
A successful attempt is an Audit Success event with Status Code 0x0; a failed one is an Audit Failure event. Microsoft documents only the success value. Caller Workstation names the computer the request came from; for a request made on the domain controller itself it holds the domain controller's own name.
Only domain controllers write the event. Where Windows LAPS manages the DSRM password (Windows Server 2019 and later domain controllers, a 2016 or later domain functional level and password encryption enabled), Microsoft does not say whether its rotations write 4794 or under which account.
How to turn it on
Advanced audit policy subcategory Audit User Account Management, Success and Failure. 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| Computer | Audit | Note |
|---|---|---|
| Domain controllers | Success and Failure | Microsoft'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 servers | Success and Failure | Both 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. |
| Workstations | Success and Failure | Both 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. |
auditpol /get /subcategory:"User Account Management"auditpol /set /subcategory:"User Account Management" /success:enable /failure:enableauditpol /get /subcategory:"{0CCE9235-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
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 tried to set the DSRM password. Event Viewer resolves it to a name when it can. | v0 |
Account NameSubjectUserNameSubject | Name of the account that tried to set the DSRM password. | v0 |
Account DomainSubjectDomainNameSubject | Domain of that account. NT AUTHORITY for well-known principals such as LOCAL SERVICE. | v0 |
Logon IDSubjectLogonIdSubject | Logon ID of the session that made the attempt, in hexadecimal. The logon event of that session (4624) on the same domain controller carries the same value. | v0 |
Caller WorkstationWorkstationAdditional Information | Caller Workstation (Event Viewer label): the name of the computer the request came from, such as DC01. The domain controller's own name when the request was made locally. | v0 |
Status CodeStatusAdditional Information | Status Code (Event Viewer label), in hexadecimal. 0x0 on success; Microsoft documents no other value. | v0 |
Values to know
Status Code Status
| Value | Meaning | Signal |
|---|---|---|
0x0 | The DSRM password was setThe DSRM rule alerts on every 4794. Setting this password is a known persistence step; confirm it against a change record. | Attack signal |
Any other value | The attempt failedMicrosoft does not list the failure codes. A failed attempt by an unexpected account still deserves a look. | Failure |
Caller Workstation Workstation
| Value | Meaning | Signal |
|---|---|---|
The domain controller's own name | The request was made on the domain controller itself | Worth knowing |
Another computer | The password was set remotelyExpected from another domain controller or a Tier 0 administration workstation; anything else is suspicious. | Worth knowing |
Volume and noise
Microsoft rates the volume of the subcategory as low, and 4794 is rare: a planned reset of the DSRM password by Tier 0 administrators, after a domain controller is promoted or as part of a recovery procedure, and possibly the rotations of Windows LAPS where it manages the DSRM password.
Keeping it manageable
- Collect 4794 from every domain controller, successes and failures, and alert on each one, as Microsoft recommends: the DSRM rule reads every event.
- Confirm each event against a change record or your Windows LAPS configuration instead of excluding accounts. Check in your own environment which account LAPS rotations appear under before treating them as expected.
- Give priority to a request whose Caller Workstation is neither a domain controller nor one of your Tier 0 administration workstations.
- After a 4794, watch for a logon of the domain controller's local Administrator (4624 with a SID ending in -500 and the domain controller's own name as the account domain) while the directory is running.
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>4794</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="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="Workstation">DC01</Data>
<Data Name="Status">0x0</Data>
</EventData>
</Event>Attacks this event reveals
Detection rules that read this event:
Frequently asked questions
Why alert on every 4794?
Microsoft recommends it. The DSRM administrator is a local administrator of the domain controller that is not managed in Active Directory, and its password is rarely changed outside planned work, so a new password set by an unexpected account, or from an unexpected computer, is a persistence step on a Tier 0 server.
Who can set the DSRM password, and from where?
Microsoft describes it as a task for members of Domain Admins, who can reset it for the domain controller they work on or for another domain controller of the domain. 4794 is written by the domain controller whose password was set, with the requesting computer in Caller Workstation, so a remote reset shows up on the target domain controller with the administrator's computer name.
Does Windows LAPS write 4794 when it rotates the DSRM password?
Microsoft does not say. Windows LAPS can manage the DSRM password on Windows Server 2019 and later domain controllers when password encryption is enabled. Check in your own environment whether its rotations write 4794 and under which account before treating them as expected.
References
- 4794(S, F): An attempt was made to set the Directory Services Restore Mode administrator password (Microsoft)
- Audit User Account Management (Microsoft)
- How to reset the Directory Services Restore Mode administrator account password (Microsoft)
- Get started with Windows LAPS and Windows Server Active Directory (Microsoft)