Skip to content

TechDirectArchive

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

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

How to create a KDS root key using PowerShell

Posted on 09/04/202009/10/2024 IT Expert By IT Expert 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

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 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

  • windows 10 hert
    Windows Management Instrumentation Commands Scripts
  • Microsoft Defender
    Attack Surface Reduction Configuration with Microsoft Defender Scripts
  • powershell
    How to perform PowerShell syntax check using PSScriptAnalyzer Scripts
  • FileNotFoundError Errno 2 No such file or directory
    Fix FileNotFoundError: [Errno 2] No such file or directory Scripts
  • PowerShell
    How to setup PowerShell on a Linux server Scripts
  • WinReg
    Unable to import Windows Reg File: The specified file is not a registry script Scripts

More Related Articles

windows 10 hert Windows Management Instrumentation Commands Scripts
Microsoft Defender Attack Surface Reduction Configuration with Microsoft Defender Scripts
powershell How to perform PowerShell syntax check using PSScriptAnalyzer Scripts
FileNotFoundError Errno 2 No such file or directory Fix FileNotFoundError: [Errno 2] No such file or directory Scripts
PowerShell How to setup PowerShell on a Linux server Scripts
WinReg Unable to import Windows Reg File: The specified file is not a registry script 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

Veeam Vanguard

  • Capture 91
    How to install IIS Web Server on Windows Server Web Server
  • how to bypass windows admin log in password 2
    How to disable Lock Screen on Windows 10 via Registry Editor Windows
  • Perform Site Maintenance or reset this site greyed out
    Fix “Perform Site Maintenance or reset this site” greyed out Windows Server
  • TERRAFORM ON LINUX FEATURE IMAGE
    How to Install Terraform on Linux Linux
  • Mendeley Cite with MSWord Issue resolved
    Mendeley Cite ECITE40001 Error: Fix issue using Microsoft Word Desktop application Mac
  • screenshot 2020 03 13 at 20.24.17
    How to view installed packages in Cygwin on Windows Windows
  • Feature image registry editing
    How to Disable and Enable Registry Access on Windows 11 Windows
  • WIinG
    Capture and Record your Screen in Windows 10 with Xbox Game Bar Windows

Subscribe to Blog via Email

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

Join 1,796 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

Active Directory 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.