⚠️ WARNING:
Thekrbtgtaccount is a special built-in account in Active Directory used by the Kerberos Key Distribution Center (KDC) to encrypt and sign all Kerberos tickets within the domain.
Improper rotation or mishandling of thekrbtgtpassword can result in domain-wide authentication failures, service outages, or loss of access for users and computers.
Only experienced administrators should use this module, and all actions must be thoroughly tested in a non-production environment before any production use.
krbtgtRotate is a PowerShell module for safely rotating the krbtgt account password in Active Directory environments. It ensures password changes do not disrupt Kerberos authentication by considering ticket lifetimes and clock skew.
- PowerShell 3.0 or later
- Active Directory module
- GroupPolicy module
- Sufficient privileges to reset the
krbtgtpassword and write to event logs
- Download or clone the repository.
- Import the module in your PowerShell session:
Import-Module .\krbtgtRotate.psd1
Before rotating the password, register the event log source:
Register-KrbtgtEventLogThis ensures logging is set up for auditing and troubleshooting.
Verify how long you must wait between rotations:
Get-KrbtgtPasswordMinimumAgeTo safely rotate the password:
Invoke-KrbtgtPasswordRotate -ForceThis command will orchestrate the rotation, sync, and logging.
Logs are written to both the event log and a file (default: current directory). Check these for status and errors.
# Register event log source
Register-KrbtgtEventLog
# Check minimum age before rotation
Get-KrbtgtPasswordMinimumAge
# Rotate password with default settings
Invoke-KrbtgtPasswordRotate -ForceSee the docs/ folder for detailed cmdlet documentation:
- Get-KrbtgtPasswordMinimumAge
- Invoke-KrbtgtPasswordRotate
- Set-KrbtgtPassword
- Register-KrbtgtEventLog
- Write-KrbtgtEventLog
- Ensure you run PowerShell as an administrator.
- Review event logs and output files for errors.
- Confirm all required modules are available.
This module is provided as-is, with no warranty, express or implied.
Users are solely responsible for thoroughly testing all functionality in a safe, non-production environment before deploying in production.
The authors and contributors accept no liability for any issues or damages resulting from the use of this code.