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

Event ID 4661: A handle to an object was requested

Written when an account opens a handle to a Security Account Manager object (the domain, a user, a group) or, on domain controllers, a directory object. Under Audit SAM it shows which groups an account looks up through SAM.

Log source
Windows Security log
Detection value
Supporting
Volume
High
Last updated
Audit subcategory
Audit SAM (Object Access, Success and Failure)
Logged on
All Windows computers
Event versions
0, 1
Detects
1 attack (2 rules)
MITRE ATT&CK
1 technique in 1 tactic
Threat groups
13 groups that MITRE ATT&CK records using these techniques
Fields the rules read
SubjectUserNameObjectServerObjectTypeObjectName

When it is written

Windows writes 4661 when a process asks the Security Account Manager (SAM) for a handle to one of its objects: the SAM server, a domain, a user, a group (SAM_GROUP) or an alias (SAM_ALIAS, a local group). On a domain controller SAM serves the domain's accounts, so lookups of domain users and groups made through the SAM remote protocol from other computers are logged there; on member servers and workstations SAM holds the local accounts. Microsoft lists no required server role for SAM objects. A request that is refused is an Audit Failure event.

Microsoft lists the event under two subcategories: Audit SAM for SAM objects, where Object Server is Security Account Manager, and Audit Directory Service Access for Active Directory objects. It documents only the SAM form, and the rules on this page read only that form.

How to turn it on

Advanced audit policy subcategory Audit SAM, 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 > Object Access > Audit SAM
Microsoft's recommendation per computer role
ComputerAuditNote
Domain controllersNot recommendedMicrosoft makes no recommendation for this subcategory unless you know exactly what you need to monitor at the Security Account Manager level.
Member serversNot recommendedMicrosoft makes no recommendation for this subcategory unless you know exactly what you need to monitor at the Security Account Manager level.
WorkstationsNot recommendedMicrosoft makes no recommendation for this subcategory unless you know exactly what you need to monitor at the Security Account Manager level.
Check the current setting
auditpol /get /subcategory:"SAM"
Based on vendor documentation.
Turn it on (local policy; a domain GPO overrides it)
auditpol /set /subcategory:"SAM" /success:enable /failure:enable
Based on vendor documentation.
The same on a Windows in another display language
auditpol /get /subcategory:"{0CCE9220-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

For the SAM form of 4661, turn on Audit SAM (Success, and Failure if you want refused requests) on the computers whose SAM you watch; for domain groups that means every domain controller. Microsoft notes that only the SACL of the SAM server object (SAM_SERVER) can be modified, so there are no auditing entries to set on individual users or groups.

Microsoft's event page also says that the event is generated only when Success auditing is enabled for the Audit Handle Manipulation subcategory, while the Audit SAM page does not mention this. If Audit SAM is on and no 4661 appears, check Audit Handle Manipulation too.

Microsoft makes no recommendation for Audit SAM unless you know exactly what you need to monitor at the SAM level, because of its volume on domain controllers.

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 IDSubjectUserSidSubject SID of the account that requested the handle. Event Viewer resolves it to a name.v0
Account NameSubjectUserNameSubject Read by 2 rulesName of the account that requested the handle. Computer accounts end with $; the rules leave them out.v0
Account DomainSubjectDomainNameSubject Domain of the account, usually as a NetBIOS name, or the computer name for a local account.v0
Logon IDSubjectLogonIdSubject Logon ID of the session, in hexadecimal. Matches the 4624 of the same session on this computer, which gives the client address for a remote request.v0
Object ServerObjectServerObjectRead by 2 rulesSubsystem that owns the object. Security Account Manager for SAM objects, the only value Microsoft documents for this event.v0
Object TypeObjectTypeObjectRead by 2 rulesType of SAM object, SAM_SERVER, SAM_DOMAIN, SAM_USER, SAM_GROUP or SAM_ALIAS.v0
Object NameObjectNameObjectRead by 2 rulesThe object. A SID for SAM_USER, SAM_GROUP and SAM_ALIAS (the rules match the end of the group SID), a distinguished name for SAM_DOMAIN and SAM_SERVER.v0
Handle IDHandleIdObjectHandle to the object, in hexadecimal. Microsoft says it can link this event to other events with the same handle, such as 4662, and that it shows 0x0 when it was not captured.v0
Process IDProcessIdProcess InformationID of the process that requested the handle, in hexadecimal. For a request that arrived over the network it is a local process of this computer, not a process of the remote client.v0
Process NameProcessNameProcess InformationFull path of the executable of that process.v0
Transaction IDTransactionIdAccess Request InformationGUID of the transaction, all zeros when it was not captured (Microsoft).v0
AccessesAccessListAccess Request InformationAccess rights requested, as %% codes from the Windows message file whose meaning depends on the object type, for example %%5400 (ListAccounts) on a domain or %%5412 (ListMembers) on a group.v0
Access ReasonsAccessReasonAccess Request InformationAccess Reasons, the list of access check results, in a format that depends on the object (Microsoft's description for event 4656). Version 1 only; not described on the page for this event.v1
Access MaskAccessMaskAccess Request InformationAccess rights requested, as a hexadecimal mask whose bits depend on the object type.v0
Privileges Used for Access CheckPrivilegeListAccess Request InformationPrivileges used for the access check, for example SeBackupPrivilege, or a dash when none was used.v0
PropertiesAccess Request InformationProperties of the object that were accessed, depending on the object type. Can be empty or a dash.v0
Restricted SID CountRestrictedSidCountAccess Request InformationNumber of restricted SIDs in the requester's token. Microsoft says it applies only to some object types.v0

Event versions

The Windows event template has two versions. Version 1 adds Access Reasons (AccessReason), the list of access check results. Microsoft's page for this event documents version 0 only and does not say which Windows release introduced version 1; it describes the field only for the similar event 4656. The sample XML on that page also shows values in the wrong fields (the privilege list, restricted SID count, process ID and process name hold data that does not belong there), so use it for the field names, not for their values.

  • Version 0: 16 fields
  • Version 1: 17 fields, adds AccessReason

Values to know

Object Server ObjectServer

ValueMeaningSignal
Security Account ManagerA SAM object (the form Microsoft documents)Both rules require this value.Expected

Object Type ObjectType

ValueMeaningSignal
SAM_GROUPA group that is not a local groupOn a domain controller, the global and universal groups of the domain. The rules count distinct groups per account and flag Domain Admins, Schema Admins and Enterprise Admins.Attack signal
SAM_ALIASA local groupOn a domain controller, the domain local and built-in groups, BUILTIN Administrators among them.Attack signal
SAM_USERA user accountWorth knowing
SAM_DOMAINA domainMicrosoft calls it the typical value for Active Directory events. Object Name holds the domain's distinguished name.Worth knowing
SAM_SERVERThe SAM server object (Microsoft describes it as a computer account)The only SAM object whose SACL can be modified.Worth knowing

Object Name ObjectName

ValueMeaningSignal
Ends with -512Domain AdminsAttack signal
Ends with -518Schema AdminsAttack signal
Ends with -519Enterprise AdminsAttack signal
S-1-5-32-544The built-in Administrators groupThe rule matches the end -32-544.Attack signal

Accesses AccessList

ValueMeaningSignal
%%5400ListAccountsListing the accounts of a domain. The value in Microsoft's sample.Worth knowing
%%5412ListMembers (on a group)Reading the members of a group.Worth knowing
%%5426ListMembers (on an alias)Reading the members of a local or built-in group.Worth knowing

Volume and noise

Microsoft rates Audit SAM high on domain controllers. Every SAM handle request is logged, so tools and services that list or look up users and groups through SAM produce a steady volume, much of it from computer accounts, which the rules leave out. On member servers and workstations the volume follows how often local accounts and groups are queried.

Keeping it manageable

  • On domain controllers, keep only ObjectType SAM_GROUP and SAM_ALIAS if volume is the limit: both rules read only those object types, and only where ObjectServer is Security Account Manager.
  • Drop requests made by computer accounts (names ending in $) at collection time only if no other use needs them: both rules leave them out.
  • Tune the counting rule (30 distinct groups opened by one account within 5 minutes, a starting value) against accounts that list groups by design, such as identity governance, audit or monitoring tools, and exclude those by SID.
  • Remember the blind spot: the rules see group lookups made through SAM only. The same information read over LDAP leaves no 4661; a hypothesis covers it with 4662 and an auditing entry on the member attribute of the administrative groups.

Sample event

Version 1, 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>4661</EventID>
    <Version>1</Version>
    <Level>0</Level>
    <Task>14080</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-1105</Data>
    <Data Name="SubjectUserName">alice</Data>
    <Data Name="SubjectDomainName">CORP</Data>
    <Data Name="SubjectLogonId">0x4c71a9</Data>
    <Data Name="ObjectServer">Security Account Manager</Data>
    <Data Name="ObjectType">SAM_GROUP</Data>
    <Data Name="ObjectName">S-1-5-21-1004336348-1177238915-682003330-512</Data>
    <Data Name="HandleId">0x1d4c8e2f760</Data>
    <Data Name="TransactionId">{00000000-0000-0000-0000-000000000000}</Data>
    <Data Name="AccessList">%%5408 %%5412</Data>
    <Data Name="AccessReason">-</Data>
    <Data Name="AccessMask">0x11</Data>
    <Data Name="PrivilegeList">-</Data>
    <Data Name="Properties">-</Data>
    <Data Name="RestrictedSidCount">0</Data>
    <Data Name="ProcessId">0x2c8</Data>
    <Data Name="ProcessName">C:\Windows\System32\lsass.exe</Data>
  </EventData>
</Event>

Attacks this event reveals

Detection rules that read this event:

Frequently asked questions

Which 4661 events point to reconnaissance of the administrative groups?

On domain controllers, events with Object Server Security Account Manager, Object Type SAM_GROUP or SAM_ALIAS and an Object Name that is the SID of Domain Admins (-512), Schema Admins (-518), Enterprise Admins (-519) or BUILTIN Administrators (S-1-5-32-544), requested by an account that is not a computer account. One account opening many different groups in a few minutes is the stronger sign.

Why do I see no 4661 events with Audit SAM turned on?

Check that the setting reaches the domain controllers with auditpol. Microsoft's event page also says the event needs Success auditing for Audit Handle Manipulation, which its Audit SAM page does not mention; check that subcategory as well.

Is 4661 logged on member servers and workstations?

Yes, for their local SAM, since Microsoft lists no required role for SAM objects. Lookups of domain groups, however, go to a domain controller and are logged there.

References