Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security, Veeam & DevOps

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form

How to create a KDS root key using PowerShell

Posted on 09/04/202015/09/2026 Christian By Christian No Comments on How to create a KDS root key using PowerShell
  1. Home
  2. Scripts
  3. How to create a KDS root key using PowerShell
Group Managed Service Accounts

If you intend to use Group Managed Service Accounts (gMSAs) feature. You will have to create a root key for the group key distribution service within Active Directory. One great benefit is that the gMSA password management moves to the Windows operating system. In this article, we will discuss how to create a KDS root key using PowerShell. Please see How to reset MySQL Root password, how to Import certificates into Trusted Root and Personal certificate store, and Create and Delete Registry Keys via PowerShell in Windows.

Due to the complexity and length of gMSA passwords, the likelihood of brute force attacks is minimized. This is used by the KDS service in Domain Controllers to generate passwords. See this post where the Group Managed Service Account was required.

Here are some interesting guides you want to read: Post OS Installation configuration of Windows Server 2019 Properties, how to install Windows Server 2016 Operating System, how to install Windows Server 2019 on a VMware Workstation, and how to install and configure Ubuntu Linux.

Create a KDS root

Run the following PowerShell command as administrator privilege. You can check the if a root key exists by running the command below in PowerShell. You will also use this to verify the creation of a kds root key.

Get-KdsRootKey 

Note: Microsoft recommends to create only one root key per domain.

Example A

Run the below syntax below in order to create a KDS rook key.

Add-KdsRootKey -EffectiveImmediately (Get-Date).Addhours(-10)Effective Time Parameter

The date on which takes effect the newly generated root key. If this parameter is not specified, the default date set is 10 days after the current date.  

create KDS root key

Here is how to enable MFA on Root Account: Create a User on AWS and Register MFA, and “Connecting to the RDP host: Fix the Certificate could not be verified back to the root certificate“.

Example B

If you would like to use this key immediately, use the cmdlet below.

KDS root key

Effective Immediately Parameter: This command creates a new root key immediately but must wait up to 10 hours to be available. This is a safety measure to make sure all domain controllers have replicated and are ready to respond to gMSA requests. 

Note: To mitigate the wait time which is advisable only in a test environment. Please use the command below. This will ensure that the key is effective 10 hours before the time of creation.

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

To verify if this Key is created correctly, use the cmdlet below

  • Get-KdsRootKey 
  • Press Enter
PowerShell command line interface displaying a list of commands starting with 'Get-' with 'Get-KdsRootKey' highlighted.

Note: This can also be verified from Active Directory Sites and Services (dssite.msc) console.

FAQs

Can the krbtgt also be reset 10 hours behind similar to the creation of the KDS rootkey?

No, the KRBTGT account password reset cannot be backdated like the KDS root key using the Add-KdsRootKey -EffectiveImmediately (Get-Date).Addhours(-10) parameter.
The KRBTGT account password reset must be performed in real-time.

When you reset the KRBTGT account password, the Kerberos Key Distribution Center (KDC) uses the new password to issue and validate Ticket Granting Tickets (TGTs) moving forward. Unlike the KDS root key, which supports backdating for Distributed Key Generation Services, resetting the KRBTGT password has no option to specify an earlier effective time.

Kerberos tickets issued prior to the reset will still be validated using the previous KRBTGT password until they expire, and a second reset can be scheduled if needed to finalize the transition.

How can the kbrtgt be reset backward?

The KRBTGT account password cannot be reset backward in time. Kerberos does not support backdating when resetting the KRBTGT account password.

Once the KRBTGT password is reset, the change takes effect immediately, and all new Ticket Granting Tickets (TGTs) are issued using the new password. There is no mechanism in Active Directory to backdate or apply a past effective time to a KRBTGT password reset.

It is recommended to reset the KRBTGT password twice with a delay (usually hours or days) between the two resets. This ensures that tickets using the old password are phased out before the second reset.

However, I hope you found this blog post on how to create a KDS root key using PowerShell helpful. Furthermore, Please let me know in the comment session if you have any questions.

Thank you for reading this post. Kindly share it with others.

  • Share on X (Opens in new window) X
  • Share on Reddit (Opens in new window) Reddit
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Facebook (Opens in new window) Facebook
  • Share on Pinterest (Opens in new window) Pinterest
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Telegram (Opens in new window) Telegram
  • Share on WhatsApp (Opens in new window) WhatsApp
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on Bluesky (Opens in new window) Bluesky
Scripts Tags:Microsoft Windows, PowerShell, Windows 10, Windows 11, Windows Server 2016

Post navigation

Previous Post: Post-Deployment of Active Directory Federation Service (ADFS)
Next Post: Create a self-signed certificate and export it in PFX format via PowerShell [Part 1]

Related Posts

  • maxresdefault 2
    How to uninstall Applications with PowerShell Script Scripts
  • S3 Bucket
    Access AWS Management Console and Create Resources with AWS CLI on Windows AWS/Azure/OpenShift
  • PowerShell
    How to setup PowerShell on a Linux server Scripts
  • Screenshot 2021 02 05 at 19.09.17
    Install and update PowerShell version 7 on Windows and Linux Scripts
  • windows 10 hert
    Windows Management Instrumentation Commands Scripts
  • powershell
    How to perform PowerShell syntax check using PSScriptAnalyzer Scripts

More Related Articles

powershell01 How to add servers to the Trusted Hosts list Scripts
powershell01 1 Create a self-signed certificate and export it in PFX format via PowerShell [Part 1] Scripts
7164 1024x575 1 How to install MDT PowerShell module on Windows Scripts
powershell How to install the Microsoft PSWindowsUpdate module silently Scripts
AzureCloudShell Provisioning Azure Resources using Azure Az PowerShell Cmdlet from Cloud Shell AWS/Azure/OpenShift
powershell logo Cannot find the computer: Fix the following error occurred while using Kerberos authentication Scripts

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

vexpert-badge-stars-5

Virtual Background

VEEAMLEGEND

Categories

Top 30 Sysadmin blog

veeaam100

Veeam Vanguard

  • Azure Local New Policy fix
    How to Resolve New WDAC Policy Issues in Azure Stack Virtualization
  • windows workstations inactivity
    Configure Windows Device Inactivity Limit Locally and Domain Wide Windows
  • SQL Error
    Fix “the server was not found or was not accessible: Verify that the instance name is correct and that SQL Server is configured to allow remote connections” Oracle/MSSQL/MySQL
  • elasticsearch error feature
    Elasticsearch: How to stop systemd service start operation from timing out Linux
  • Basic Cisco Switch Configuration
    Configure a username and secret on a Cisco Switch and Router Network | Monitoring
  • MBAM
    The web application “Administration Portal” cannot be enabled because one or more software dependencies are not met Windows
  • MBRGPT
    Run MBR and GPT conversion with the best GPT converter Windows
  • ARI Banner e1784558934898
    Azure Resource Inventory (ARI) for Engineers: Improving Control and Compliance AWS/Azure/OpenShift

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,746 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Contact
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon
  • Bsky

Tags

Active Directory Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2026 TechDirectArchive

Loading Comments...

You must be logged in to post a comment.