A group Managed Service Account (gMSA) usually fails with one word: Test-ADServiceAccount returns False, or Install-ADServiceAccount reports an error that says very little. This guide takes the causes one at a time, with the command that checks each one and the fix. If you have not created the account yet, start with the gMSA setup guide; this page is its troubleshooting companion.
Short answer: Test-ADServiceAccount returns False when the computer cannot retrieve the gMSA password or cannot use the account’s Kerberos encryption types. Check four things in order: a KDS root key exists and was created at least 10 hours ago (Get-KdsRootKey); the computer, or a group it belongs to, is in the gMSA’s PrincipalsAllowedToRetrieveManagedPassword; the computer has picked up its new group membership (restart it, or purge its tickets with klist -li 0x3e7 purge); and the gMSA allows AES if RC4 is disabled. Then run Install-ADServiceAccount and Test-ADServiceAccount again from an elevated PowerShell session. (Reviewed November 2026.)
Read the warning first
Run the test on the server that will use the account, not on a domain controller. When it fails, PowerShell prints a warning before the False. It names the two usual causes:
PS C:\> Test-ADServiceAccount -Identity svc-web01
WARNING: Test failed for Managed Service Account svc-web01. If standalone Managed Service Account, the account is
linked to another computer object in the Active Directory. If group Managed Service Account, either this computer does
not have permission to use the group MSA or this computer does not support all the Kerberos encryption types required
for the gMSA. See the MSA operational log for more information.
False
The detail is in Event Viewer under Applications and Services Logs, Microsoft, Windows, Security-Netlogon. Event 9002 means Netlogon could not add the account and includes the reason, such as {Access Denied}. Event 9001 means the machine does not support all of the account’s encryption types.
KDS root key missing or too new
Domain controllers compute gMSA passwords from a Key Distribution Services (KDS) root key. Without one, you cannot create a gMSA at all. Check for a key on a DC:
Get-KdsRootKey
Test-KdsRootKey -KeyId <KeyId from the output above>
If nothing comes back, create the key as a member of Domain Admins or Enterprise Admins. A failure reported on Microsoft Q&A when the key is missing or not yet usable is New-ADServiceAccount : Key does not exist.
Add-KdsRootKey -EffectiveImmediately
Despite the name, the key is not usable at once. Domain controllers wait up to 10 hours from creation so that every DC has replicated the key before any gMSA password is generated. Confirm the key with event 4004 in the KdsSvc Operational log, then wait.
Microsoft documents a shortcut for a test forest with a single DC: backdate the key so the wait has already passed.
# Single-DC lab only
Add-KdsRootKey -EffectiveTime ((Get-Date).AddHours(-10))
Microsoft’s container documentation says plainly not to use this in production. The wait is a safety margin. Backdating removes it, so a DC that has not replicated the key yet cannot answer gMSA requests. Also create only one KDS root key per forest; several keys can make gMSAs fail after a password rotation. If you delete and re-create the key, restart the KDC service on every DC, because the old key can stay cached.
Computer not allowed to retrieve the password
This is the most common cause. The computer account must be listed in the gMSA’s PrincipalsAllowedToRetrieveManagedPassword, directly or through a group. Compare the two lists:
# Groups this computer is in
Get-ADComputer $env:COMPUTERNAME | Get-ADPrincipalGroupMembership | Select-Object DistinguishedName
# Principals allowed to retrieve the gMSA password
(Get-ADServiceAccount svc-web01 -Properties PrincipalsAllowedToRetrieveManagedPassword).PrincipalsAllowedToRetrieveManagedPassword
If the computer is missing, add it to the allowed group. Note the trailing $ on computer account names:
Add-ADGroupMember -Identity 'gMSA-web-hosts' -Members 'WEB01$'
Here is the step people miss. A computer’s group memberships are in its Kerberos ticket, so a server added to the group a minute ago still has the old list. Microsoft’s documented fix is to restart the computer. If you cannot restart yet, purge the tickets of the computer’s own logon session (LUID 0x3e7) from an elevated prompt, then test again:
klist -li 0x3e7 purge
Test-ADServiceAccount -Identity svc-web01
If the test still fails, restart the server.
Install-ADServiceAccount errors
Install-ADServiceAccount must run in an elevated session and does not work against a read-only domain controller. Its -AccountPassword and -PromptForPassword parameters are ignored for a gMSA. The account must already have PrincipalsAllowedToRetrieveManagedPassword set, or the install fails.
The error most people see, as posted on Microsoft Q&A, is:
Install-ADServiceAccount : Cannot install service account. Error Message: 'An unspecified error has occurred'.
The message itself does not name the cause. The Netlogon log does. In one reported case, event 9002 read:
Netlogon failed to add gmsa_test as a managed service account to this local machine. {Access Denied}
A process has requested access to an object, but has not been granted those access rights.
Access Denied points to the previous section: the computer is not allowed, or has not picked up its new group membership. In that report, the install worked once the server got a new Kerberos ticket. If event 9002 instead says “The provided context did not match the target”, and event 9001 is also logged, the cause is encryption types. That is the next section.
Supported encryption types
Every host that installs or logs on as a gMSA must support the Kerberos encryption types the account requires. The DC reads the account’s msDS-SupportedEncryptionTypes attribute. If the attribute is empty, the DC assumes the stronger types are not supported. A host configured not to use RC4 then always fails. Event 9001 looks like this:
The account svc-web01 cannot be used as a managed service account on the local machine because not all of the supported encryption types are supported by the local machine.
Compare what the host allows with what the account allows, then set AES explicitly on the gMSA. Microsoft says AES should always be configured for managed service accounts.
# On the host: types allowed by policy (0x7ffffff8 = AES128, AES256 and future types)
reg query "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System\Kerberos\Parameters" /v SupportedEncryptionTypes
# On the account
Get-ADServiceAccount svc-web01 -Properties msDS-SupportedEncryptionTypes
Set-ADServiceAccount -Identity svc-web01 -KerberosEncryptionType AES128,AES256
Run Install-ADServiceAccount and Test-ADServiceAccount again afterwards. This failure often appears right after an RC4 hardening change; see the Kerberos RC4 removal audit to find other accounts that will break the same way.
Functional level, schema and the AD module
Microsoft’s current guidance is that both domain and forest functional levels should be Windows Server 2012 or later to support gMSA features for all devices. The older Windows Server 2012 documentation adds that the schema must be at the Windows Server 2012 level (objectVersion 52 or higher) and that at least one Windows Server 2012 or later DC must be in the domain. Check both:
Get-ADDomain | Select-Object DomainMode
Get-ADForest | Select-Object ForestMode
Get-ADObject (Get-ADRootDSE).schemaNamingContext -Properties objectVersion
If the levels are too low, follow raise the AD forest and domain functional level safely.
If Test-ADServiceAccount is “not recognized”, the host lacks the Active Directory module for PowerShell. You do not need the AD DS role for this. Install the module only:
# Windows Server
Install-WindowsFeature RSAT-AD-PowerShell
# Windows 10 1809 or later, Windows 11
Add-WindowsCapability -Online -Name 'Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0'
For other ways to add the tools on a workstation, see install RSAT on Windows 11.
Service will not start with the gMSA
Once Test-ADServiceAccount returns True, set the service to use the account. In Services, open the service, go to the Log On tab, choose This account, and enter the name with a trailing dollar sign, for example CORP\svc-web01$. Leave both password boxes empty. Windows gets the password from Active Directory.
If the service still fails, check three things:
- The name. It must be in the form
DOMAIN\name$, with the trailing$, and the password boxes must be empty. - The “Log on as a service” right (SeServiceLogonRight). The gMSA needs it on that host. If a GPO defines this right, local changes are overwritten at the next policy refresh, so add the gMSA in the GPO. “Deny log on as a service” overrides it.
- The service’s managed-account flag. If System event 7038 says “The user name or password is incorrect”, check the flag with
sc.exe qmanagedaccount <service>. If it shows False, set it withsc.exe managedaccount <service> true.
Scheduled tasks need PowerShell
Microsoft lists Task Scheduler as a supported way to run as a gMSA but gives no steps for it. The method answered on Microsoft Q&A is to build the principal in PowerShell with the logon type Password and no password, then assign it to the task:
$p = New-ScheduledTaskPrincipal -UserId 'CORP\svc-web01$' -LogonType Password
Set-ScheduledTask -TaskName 'Nightly export' -Principal $p
Run this elevated on a host where Test-ADServiceAccount already returns True. Use single quotes so PowerShell does not read $ as the start of a variable.
SPNs and Kerberos delegation
A service running as a gMSA authenticates as the gMSA, not as the computer. Its SPNs therefore belong on the gMSA object. If users fall back to NTLM or get Kerberos errors, list the SPNs and check for duplicates:
setspn -L svc-web01$
setspn -X
Set-ADServiceAccount -Identity svc-web01 -ServicePrincipalNames @{Add='HTTP/web.corp.example.com'}
Clients find the account by the name they use to reach the service, so a load-balanced or alias name needs its own SPN. With setspn, add SPNs using -S, which checks for duplicates first.
Delegation settings also go on the gMSA. For resource-based constrained delegation, -PrincipalsAllowedToDelegateToAccount on the back-end gMSA lists the accounts that may act for users against it. -TrustedForDelegation turns on unconstrained delegation. Avoid it unless you have a documented need.
Password rotation interval
The password changes every 30 days unless you set -ManagedPasswordIntervalInDays when you create the account. That value can only be set at creation; after that it is read-only, and Set-ADServiceAccount has no parameter for it. To use a different interval, create a new gMSA with the interval you want and move the service to it. To read the current value:
Get-ADServiceAccount svc-web01 -Properties msDS-ManagedPasswordInterval
Symptom, cause and fix
| Symptom | Cause | Fix |
|---|---|---|
New-ADServiceAccount : Key does not exist | No KDS root key, or the key is less than 10 hours old | Get-KdsRootKey; create one with Add-KdsRootKey -EffectiveImmediately and wait 10 hours |
Test-ADServiceAccount returns False with the “Test failed” warning | Computer not in PrincipalsAllowedToRetrieveManagedPassword | Add the computer account to the allowed group |
| Still False after adding the computer to the group | The computer’s Kerberos ticket has the old group list | Restart, or run klist -li 0x3e7 purge and test again |
| “An unspecified error has occurred” and Netlogon 9002 with {Access Denied} | Not allowed to retrieve the password, or group change not picked up | Fix the allowed principals, refresh the ticket, run the install again |
| Netlogon 9001, or 9002 with “The provided context did not match the target” | Encryption type mismatch, often after RC4 is disabled | Set-ADServiceAccount -KerberosEncryptionType AES128,AES256 |
Test-ADServiceAccount is not recognized | AD PowerShell module missing | Install-WindowsFeature RSAT-AD-PowerShell |
| Service fails to start, event 7038 | Wrong name format, missing logon right, or managed-account flag off | Use DOMAIN\name$ with a blank password; grant “Log on as a service”; sc.exe managedaccount <service> true |
| Need a different password interval | ManagedPasswordIntervalInDays is read-only after creation | Create a new gMSA with the interval you want |
How this was checked: commands and behaviour verified against Microsoft’s documentation (November 2026); not run in our lab.
Official documentation: Get started with group managed service accounts, Create the KDS root key, Test-ADServiceAccount, Install-ADServiceAccount, New-ADServiceAccount, Troubleshoot gMSAs, klist.
Related guides: Create and use group Managed Service Accounts (gMSA) · Audit and remove Kerberos RC4 · Raise the AD forest and domain functional level safely · Install RSAT on Windows 11.
Frequently asked questions
Why does Test-ADServiceAccount still return False after I added the server to the group?
The server’s Kerberos ticket still carries its old group memberships. Restart the server, or purge the computer’s tickets with klist -li 0x3e7 purge from an elevated prompt, then run the test again.
Can I change the gMSA password interval after creating it?
No. ManagedPasswordIntervalInDays can only be set when the account is created and is read-only afterwards. Create a new gMSA with the interval you want and move the service to it.
Is it safe to backdate the KDS root key with -EffectiveTime?
Only in a test forest with one domain controller. Microsoft says not to use it in production. The 10-hour wait gives every DC time to replicate the key before gMSA passwords are generated.
Do services have to restart when the gMSA password changes?
No. Active Directory updates the gMSA password without restarting services, and member hosts can obtain both the current and the previous password from a domain controller.
Does the server that uses the gMSA need the AD DS role?
No. To run Install-ADServiceAccount and Test-ADServiceAccount on a member server, install the Active Directory module for PowerShell with Install-WindowsFeature RSAT-AD-PowerShell.
