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

Event ID 16991: The security account manager blocked a non-administrator from creating or renaming a computer account

Written by a domain controller when it refuses a user without administrator rights a computer account name that does not end with a single $, a check added in November 2021 (CVE-2021-42278). The trace of a refused spoofing attempt.

Log source
Windows System log
Detection value
Supporting
Volume
Low (estimate)
Last updated
Log
System log (Microsoft-Windows-Directory-Services-SAM, on by default)
Logged on
Domain controllers only
Event versions
0
Detects
1 attack (1 rule)
MITRE ATT&CK
1 technique in 1 tactic
Threat groups
1 group that MITRE ATT&CK records using these techniques
Fields the rules read
The event ID and the provider only

When it is written

A domain controller writes 16991 when the Security Accounts Manager refuses to create or rename a computer account because the new sAMAccountName does not end with a single dollar sign. Since the Windows updates of November 9, 2021 (CVE-2021-42278), the sAMAccountName of a computer account that carries the workstation trust account flag must end with exactly one $. A request that fails gets the error 0x523 (ERROR_INVALID_ACCOUNTNAME) and the event is logged.

The check applies only to users who do not have administrator rights for machine accounts, and for existing accounts it runs when such a user changes sAMAccountName or userAccountControl. A rename by an administrator is not checked; it appears as event 4781 in the Security log.

CVE-2021-42278 is the weakness that let an attacker impersonate a domain controller by renaming a computer account to the domain controller's name without the trailing $. On an updated domain controller that rename is refused and this event is what remains of the attempt.

How to turn it on

Microsoft-Windows-Directory-Services-SAM writes the event to the System log (Event Viewer > Windows Logs > System), which is on by default. Microsoft

There is nothing to switch on: domain controllers with the Windows updates released on November 9, 2021 or later run the check and write the event to the System log. To find computer accounts that already have a non-compliant name (created before the updates or by administrators), Microsoft gives a read-only query:

Get-ADComputer -LDAPFilter "(samAccountName=*)" | ? SamAccountName -NotLike "*$" | select DNSHostName, Name, SamAccountName

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
Attempted sAMAccountNameSamAccountNamesAMAccountName that was requested for the computer account (shown as Attempted sAMAccountName). The message repeats it with a $ appended as Recommended sAMAccountName; that line is the same value, not a field of its own.v0

Values to know

Attempted sAMAccountName SamAccountName

ValueMeaningSignal
A domain controller's name without the $The name the spoofing technique needsThe first step of sAMAccountName spoofing, refused. Find who tried it and which computer account they control.Attack signal
Any other name without a trailing $A computer account name that breaks the naming ruleUsually a provisioning or join tool that leaves out the $. Fix the tool.Worth knowing
A name ending with more than one $Also refusedThe name must end with a single dollar sign.Worth knowing

Volume and noise

Rare. The usual cause is a provisioning or domain join tool that writes computer account names without the $; it fails every time on an updated domain controller, so the event repeats until the tool is fixed. The other is a user renaming a computer account directly. By default authenticated users can create up to 10 computer accounts in the domain, so the caller can be any domain user.

Keeping it manageable

  • Keep every 16991: the volume is low and the rule matches only the event ID and the Directory-Services-SAM provider. Collect the System log of every domain controller, since only the one that handled the request logs it.
  • Compare SamAccountName with the names of your domain controllers without the $. A match is the sAMAccountName spoofing pattern and needs immediate attention; any other name is more likely a broken tool.
  • The event does not name the caller. Look for the computer account's other changes around the same time in the Security log (4741 when it was created, 4742 and 4781 for changes and renames) to find who made the request.

Sample event

Version 0, with made-up values.

<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Microsoft-Windows-Directory-Services-SAM" Guid="{0d4fdc09-8c27-494a-bda0-505e4fd8adae}" />
    <EventID>16991</EventID>
    <Version>0</Version>
    <Level>2</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x8000000000000000</Keywords>
    <TimeCreated SystemTime="2026-11-18T09:30:12.4567890Z" />
    <EventRecordID>1048576</EventRecordID>
    <Correlation />
    <Execution ProcessID="712" ThreadID="2408" />
    <Channel>System</Channel>
    <Computer>DC01.corp.example.com</Computer>
    <Security />
  </System>
  <EventData>
    <Data Name="SamAccountName">DC01</Data>
  </EventData>
</Event>

Attacks this event reveals

Detection rules that read this event:

Frequently asked questions

Does event 16991 mean someone tried sAMAccountName spoofing?

It means a user without administrator rights tried to give a computer account a name without a single trailing dollar sign, and the domain controller refused. If the attempted name is the name of one of your domain controllers without the dollar sign, it is the first step of sAMAccountName spoofing (CVE-2021-42278). Any other name usually comes from a tool that does not add the dollar sign.

Why does event 16991 not show who made the request?

The event has a single data field, the attempted name. Use the Security log of the same domain controller (4741, 4742, 4781) to find the computer account's creator and its other changes, and the creator recorded on the computer object (ms-DS-CreatorSID, which Microsoft names for counting the accounts a user created).

Is a rename to a name without the dollar sign by an administrator logged as 16991?

No. Microsoft applies the check only to users who do not have administrator rights for machine accounts. An administrator's rename is not refused and appears as event 4781 in the Security log, which is where the library's sAMAccountName spoofing hypothesis starts.

References