microsoftarchive / New-KrbtgtKeys.ps1

This script will enable you to reset the krbtgt account password and related keys while minimizing the likelihood of Kerberos authentication issues being caused by the operation.
MIT License
402 stars 89 forks source link

Does not support single label domains #12

Open aut0pil0t opened 2 years ago

aut0pil0t commented 2 years ago

DNS resolution check on Single Label Domains fail and the script does not continue. Adding the snippet below before the line [System.Net.Dns]::gethostentry($targetedADforestFQDN) | Out-Null and replacing targetedADforestFQDN with targettedDnsFqdn worked for me.

$targettedDnsFqdn = if ($targetedADforestFQDN -notmatch ".") { $targetedADforestFQDN + "." } else { $targetedADforestFQDN }