banshee/active-directory-collection/active-directory/winrm/
krbtgt
The age of the password of the krbtgt accounts of a domain, by WinRM, PowerShell and LDAP
par banshee1 installation2 versions
v2Dernière
Publiée le 28 octobre 2026. One naming convention across collections; documentation completed.
Age of the krbtgt password, by WinRM
Returns the age, in days, of the password of each krbtgt account of the domain of a domain controller: the key that signs every Kerberos ticket of the domain. A ticket forged with a stolen copy of that key stays valid as long as the key is not changed. Two watches are proposed, both checked: a password too old, and the account krbtgt not found.
Versions
A domain controller running Windows Server 2012 or later, with Windows PowerShell 3.0 or later, as the prerequisites name them. Generic: no folder of version. That every release answers alike is assumed, not yet checked on a real domain controller.
How it works
The collector runs one PowerShell script, by WinRM, that searches the directory over LDAP, on the domain controller itself, for the users whose sAMAccountName starts with krbtgt:
$ErrorActionPreference = 'Stop'; [Console]::OutputEncoding = New-Object System.Text.UTF8Encoding; $computer = Get-CimInstance Win32_ComputerSystem; $server = $computer.DNSHostName + '.' + $computer.Domain; $rootDSE = [ADSI]('LDAP://' + $server + '/RootDSE'); $domain = [ADSI]('LDAP://' + $server + '/' + $rootDSE.Properties['defaultNamingContext'][0]); $searcher = New-Object DirectoryServices.DirectorySearcher($domain, '(&(objectCategory=person)(objectClass=user)(sAMAccountName=krbtgt*))', @('sAMAccountName', 'pwdLastSet')); $now = [DateTime]::UtcNow; $accounts = @($searcher.FindAll() | ForEach-Object { @{name = [string]$_.Properties['samaccountname'][0]; days = [long]($now - [DateTime]::FromFileTimeUtc([long]$_.Properties['pwdlastset'][0])).TotalDays} }); ConvertTo-Json -Compress -Depth 4 -InputObject @{accounts = $accounts} - WinRM hands the script to PowerShell itself: the script is the one of
active-directory/ssh/krbtgt, without thepowershell -Command "…"thatcmd.exeneeds there. - The search starts at the domain,
defaultNamingContextof theRootDSEof the domain controller, and reads two attributes of the schema of Active Directory:sAMAccountNameandpwdLastSet, the time of the last change of the password, in hundreds of nanoseconds since 1 January 1601 UTC. The age is counted in whole days, on the domain controller. - The accounts found are
krbtgt, the key of the domain, andkrbtgt_<number>, the key of each read-only domain controller; any other account whose name starts withkrbtgtis returned too. - No krbtgt account found stops the collector as misconfigured, as does an answer that is not the expected JSON.
Nothing is written to the Windows or to the directory: the script only reads. Changing the krbtgt password is the work of an administrator, twice, a replication apart.
Prerequisites
- A domain controller running Windows Server 2012 or later, with Windows PowerShell 3.0 or later.
- The WinRM service listening in HTTPS, on TCP 5986 or the port set in
protocol:winrm:port, open in the Windows firewall to the poller, with a certificate the poller judges by the TLS profile of the probe or pins inprotocol:winrm:fingerprint: the steps are those of thewindows/winrm/servicescollector ofbanshee/windows-collection. NTLM authentication, which the WinRM service accepts as installed. - An account of the domain for monitoring, without administrator rights, set in
protocol:winrm:user(DOMAIN\accountoraccount@domain) with its password inprotocol:winrm:password, member of the group "Remote Management Users" of the domain (on a domain controller, the built-in group of theBuiltincontainer). No other group is given here (see Limits).
Outputs
| Name | Label | Unit | Per instance |
|---|---|---|---|
age | Password age | d | yes, per account |
Watches
| Name | Title | Kind | Defaults | Checked by default |
|---|---|---|---|---|
old | krbtgt password old | high threshold, on age | warning above 180 d, critical above 365 d | yes |
missing | krbtgt account missing | expected instances, on age | critical when krbtgt is not found | yes |
Limits
- Not yet checked on a real domain controller: the execution; that an account of the domain without administrator rights reads
pwdLastSetof the krbtgt accounts. The accounts are protected byAdminSDHolder, whose rights a domain may have narrowed. If it may not, the collector stops as misconfigured, or returns no account; the right to read the attribute is then given to the account on those objects, never by making it an administrator.