Use this when running services on several servers with a managed password.
gMSA
A gMSA (group managed service account) is an AD service account whose 240-character password is managed by the domain and retrievable only by authorized hosts, so services across several servers run without stored passwords.
1. gMSA: AD-managed passwords usable by multiple hosts.
2. Requires KDS root key.
3. Restrict PrincipalsAllowedToRetrieveManagedPassword.
4. Works for services, tasks, IIS, SQL.
5. Rotated automatically (30 days).
KDS → gMSA password → allowed hosts
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Test-ADServiceAccount -Identity svc-webVerification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Checks Verify boundary
Test-ADServiceAccount -Identity svc-web # on the host: should return True
Get-ADServiceAccount svc-web -Properties PrincipalsAllowedToRetrieveManagedPassword
If Test-ADServiceAccount is False, check the host is in the allowed group (and rebooted or klist purge -li 0x3e7 after group change) and that the KDS root key is effective (10 hours after creation in production).
Step 2 Common mistakes Narrow the fault
- Hosts not allowed to retrieve the gMSA password (
PrincipalsAllowedToRetrieveManagedPassword). - KDS root key missing.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Password is 240 characters and rotates automatically.
- Only authorized hosts can retrieve it.
- Requires a KDS root key.
Get-ADServiceAccount -Filter * -Properties PrincipalsAllowedToRetrieveManagedPassword— gMSA and allowed hostsTest-ADServiceAccount <gmsa>— works on hostGet-KdsRootKey— KDS root key exists
ReferenceImportant terms & boundaries1 section · depth on demand
In depth
Group Managed Service Accounts (gMSA) give services, scheduled tasks and application pools a domain identity whose password is generated and rotated automatically by Active Directory (every 30 days by default). Nobody knows the password, so it cannot be leaked, reused or cracked from a weak choice.
Add-KdsRootKey -EffectiveImmediately # once per forest (wait for replication in production)
New-ADServiceAccount -Name gmsa-netsync -DNSHostName gmsa-netsync.corp.example.com `
-PrincipalsAllowedToRetrieveManagedPassword 'SG-NetSync-Hosts'
Install-ADServiceAccount gmsa-netsync # on the host
Test-ADServiceAccount gmsa-netsync
Limit PrincipalsAllowedToRetrieveManagedPassword to the exact hosts that run the service, since anyone in that group can read the password.
ReferenceConfiguration & state1 section · depth on demand
Setup
Add-KdsRootKey -EffectiveImmediately # once per forest; wait for replication
New-ADServiceAccount -Name svcWeb -DNSHostName svcWeb.example.com `
-PrincipalsAllowedToRetrieveManagedPassword "WebServers"
Install-ADServiceAccount svcWeb # on each server
Test-ADServiceAccount svcWeb
Documented example, not captured output. Configure the service to run as EXAMPLE\svcWeb$ with an empty password.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Active Directory Security → gMSA. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/windows/security/ · confidence 94%