Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form
Home » Scripts » How to create a KDS root key using PowerShell
  • Root
    Change your root password: Manage the root user on your macOS Mac
  • Screenshot 1
    Fix SMB Freezes That Break Backups on Critical Linux Servers Network | Monitoring
  • Secure Web Server
    How to secure a Web Server on a Windows VM in Azure using TLS/SSL Certificates Saved in Azure Key Vault AWS/Azure/OpenShift
  • Could not load file or assembly
    Unable to edit MDT XML unattended file: Could not load file Windows Server
  • image 78
    How to enable LDAP over SSL with a third-party Certificate such as DigiCert Windows
  • Windows10
    Configure new GPO settings and Security baseline for Windows Windows
  • SOBR   implementing 3 2 1 Rule
    Achieve 3-2-1 rule with SOBR on Synology or OOTBI and Wasabi Backup
  • images
    Fix the Synchronization service scheduler is suspended AWS/Azure/OpenShift

How to create a KDS root key using PowerShell

Posted on 09/04/202009/10/2024 Christian By Christian No Comments on 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

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.

5/5 - (1 vote)

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 Pocket (Opens in new window) Pocket
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on Bluesky (Opens in new window) Bluesky
  • Share on Threads (Opens in new window) Threads
  • Share on Nextdoor (Opens in new window) Nextdoor
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

  • PowerShell
    How to setup PowerShell on a Linux server Scripts
  • windows update 03
    How to automate Windows Update with PowerShell Scripts
  • powershell logo
    Cannot find the computer: Fix the following error occurred while using Kerberos authentication Scripts
  • 7164 1024x575 1
    How to install MDT PowerShell module on Windows Scripts
  • FileNotFoundError Errno 2 No such file or directory
    Fix FileNotFoundError: [Errno 2] No such file or directory Scripts
  • powershell01
    WinRM and PSRemoting: Configure servers for remote access Scripts

More Related Articles

PowerShell How to setup PowerShell on a Linux server Scripts
windows update 03 How to automate Windows Update with PowerShell Scripts
powershell logo Cannot find the computer: Fix the following error occurred while using Kerberos authentication Scripts
7164 1024x575 1 How to install MDT PowerShell module on Windows Scripts
FileNotFoundError Errno 2 No such file or directory Fix FileNotFoundError: [Errno 2] No such file or directory Scripts
powershell01 WinRM and PSRemoting: Configure servers for remote access Scripts

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

sysadmin top30a

  • Root
    Change your root password: Manage the root user on your macOS Mac
  • Screenshot 1
    Fix SMB Freezes That Break Backups on Critical Linux Servers Network | Monitoring
  • Secure Web Server
    How to secure a Web Server on a Windows VM in Azure using TLS/SSL Certificates Saved in Azure Key Vault AWS/Azure/OpenShift
  • Could not load file or assembly
    Unable to edit MDT XML unattended file: Could not load file Windows Server
  • image 78
    How to enable LDAP over SSL with a third-party Certificate such as DigiCert Windows
  • Windows10
    Configure new GPO settings and Security baseline for Windows Windows
  • SOBR   implementing 3 2 1 Rule
    Achieve 3-2-1 rule with SOBR on Synology or OOTBI and Wasabi Backup
  • images
    Fix the Synchronization service scheduler is suspended 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,832 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

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

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.