A security solution that detects identity-based threats and suspicious activities in on-premises Active Directory environments
AFAIK, there are a few additional options...
- Host/Service level auditing
Event ID 4662 targets the Domain Controller (DC) tracking the password request, but the member servers fetching and running the services generate their own events.
- Event ID 2946 (Microsoft-Windows-Security-Netlogon): This event logs on the host server whenever it successfully reads the gMSA
msDS-ManagedPasswordattribute. This is highly useful for validating which servers are natively fetching the password using the Group Policy/Netlogon mechanism versus third-party actors. - Event ID 4624 (Security - Type 5 Logon): When the service initializes, it logs a Logon Type 5 (Service) on the host. You can cross-reference the
TargetUserName(the gMSA account name) to verify that a background service actually spawned under that identity. - Failed Retrievals (Event ID 4211 / Netlogon errors): If a stale host or an unauthorized host attempts to fetch the password but lacks permissions, it logs failures under the
Microsoft-Windows-Directory-Services-Service-Principal-Nameor Netlogon logs.
- Native AD tooling
You can query the Attribute Replication Metadata via PowerShell to see when and which DC last modified or replicated the gMSA object.
Get-ADReplicationAttributeMetadata -Object "CN=yourgMSA,CN=Managed Service Accounts,DC=domain,DC=com" -Server "YourDC"
- Microsoft Defender for Identity and Sentinel
Both platforms natively parse identity telemetry to surface anomalous gMSA behavior.
MDI treats service accounts with high value. You can tag your gMSAs as Sensitive or use the Honeytoken feature inside the Microsoft Defender portal. If an unauthorized endpoint or user attempts to enumerate or read the properties of a Honeytoken gMSA, MDI generates an instant high-severity alert.
MDI flags automated sensor authentication health. If you are using a gMSA for the MDI Directory Service Account (DSA) sensor itself, MDI monitors its password rotation state and fires a health alert if the workspace-level credentials fall out of sync.
If you deploy newer v3.x sensors, you can turn on Automatic Windows auditing configuration under Settings -> Identities -> Advanced features. This ensures your DC advanced audit policies don't suffer from configuration drift or manual GPO overrides.
Once your 4662 logs are flowing into Sentinel via the Windows Security Events connector, you can run KQL hunting rules. Because regular hosts retrieve passwords roughly every 30 days, any user account or unexpected host querying msDS-ManagedPassword is a major indicator of credential exposure or reconnaissance.
To detect non-computer accounts or unauthorized hosts fetching gMSA passwords, try the following
SecurityEvent
| where EventID == 4662
| where ObjectServer == "DS"
// msDS-ManagedPassword attribute GUID
| where Properties has "7622da0d-9b0f-48c2-84c4-754f33744040"
// Extract the account doing the requesting
| extend RequestingAccount = Account
// Filter out legitimate machine accounts if they follow a naming convention (e.g., ends with $)
// Or filter by an approved Watchlist of servers allowed to use gMSAs
| where not(RequestingAccount endswith "$")
| project TimeGenerated, Computer, RequestingAccount, ObjectName, SubjectLogonId
If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.
hth
Marcin