Skip to content
Sponsor
3.0 preview2.3.0 stable

These docs describe the preview. Pick the version you run and every page marks what it doesn't have yet. Get the preview →
Maester 2.x docs (archived) →

KDS root key count should be acceptable

AD-CFG-22InfoActive DirectoryDirectory configuration

Part of Active Directory · Active Directory · Directory configuration · All checks

Run this check
Invoke-Maester -TestId AD-CFG-22

KDS root keys are used to generate keys required for Group Managed Service Accounts (gMSA) and related group-managed credential operations.

If KDS root keys are missing, misconfigured, or unexpectedly changed, service account provisioning can fail—potentially causing insecure workarounds or prolonged downtime.

Monitoring the count of KDS root keys helps identify:

  • Missing keys that prevent proper gMSA key derivation
  • Exactly two keys, which can cause gMSA authentication failures in some scenarios

Operational

  • Ensure one or three (or more) KDS root keys exist per forest. Exactly two keys can cause gMSA authentication failures in some sorting scenarios.
  • If exactly two keys exist, Microsoft’s recommended workaround is to create a third key. Do not remove existing keys.
  • Validate the expected number of keys for your environment and alert on deviations.
  • Restrict administrative access to actions that can modify KDS root keys.

The test enumerates KDS root keys present in Active Directory and evaluates the count:

  • 0 keys: gMSAs are not in use; the test is skipped.
  • 1 key: The recommended configuration; the test passes.
  • 2 keys: Can cause gMSA authentication failures in some scenarios; the test returns Investigate.
  • 3+ keys: Acceptable per Microsoft guidance (the workaround for the sorting issue is to add a third key); the test passes.
Every attribute of this check
FieldValue
Test IDAD-CFG-22
SeverityInfo
SuiteActive Directory
ProductActive Directory
FeatureDirectory configuration
AreaInfrastructure hardening
Resource typeTenant
MITRE ATT&CKNone
PowerShell testTest-MtAdKdsRootKeysCount
ServicesActiveDirectory
PermissionsActiveDirectory:Ldap:Configuration/*:ReadProperty