Create the Key Distribution Services KDS Root Key

Posted: August 30, 2020 in Windows

Domain Controllers (DC) require a root key to begin generating gMSA passwords. The domain controllers will wait up to 10 hours from time of creation to allow all domain controllers to converge their AD replication before allowing the creation of a gMSA. The 10 hours is a safety measure to prevent password generation from occurring before all DCs in the environment are capable of answering gMSA requests. If you try to use a gMSA too soon the key might not have been replicated to all domain controllers and therefore password retrieval might fail when the gMSA host attempts to retrieve the password. gMSA password retrieval failures can also occur when using DCs with limited replication schedules or if there is a replication issue.

Membership in the Domain Admins or Enterprise Admins groups, or equivalent, is the minimum required to complete this procedure. For detailed information about using the appropriate accounts and group memberships, see Local and Domain Default Groups.

To create the KDS root key using the Add-KdsRootKey cmdlet

  1. On the Windows Server 2012 or later domain controller, run the Windows PowerShell from the Taskbar.
  2. At the command prompt for the Windows PowerShell Active Directory module, type the following commands, and then press ENTER:Add-KdsRootKey -EffectiveImmediately

For test environments with only one DC, you can create a KDS root key and set the start time in the past to avoid the interval wait for key generation by using the following procedure. Validate that a 4004 event has been logged in the kds event log.

To create the KDS root key in a test environment for immediate effectiveness

  1. On the Windows Server 2012 or later domain controller, run the Windows PowerShell from the Taskbar.
  2. At the command prompt for the Windows PowerShell Active Directory module, type the following commands, and then press ENTER:$a=Get-Date

    $b=$a.AddHours(-10)

    Add-KdsRootKey -EffectiveTime $b

    Or use a single command

    Add-KdsRootKey -EffectiveTime ((get-date).addhours(-10))

 

Leave a comment