Skip to content

Instantly share code, notes, and snippets.

@roberttoups
Created November 4, 2020 16:01
Show Gist options
  • Save roberttoups/6b86b0a89164ba7c138641529829c94d to your computer and use it in GitHub Desktop.
Save roberttoups/6b86b0a89164ba7c138641529829c94d to your computer and use it in GitHub Desktop.
Install a Group Managed Service Account on a Windows system
$SamAccountName = 'gmsa-Account'
klist -lh 0 -li 0x3e7 purge # resets Kerberos tickets
$TestResult = Test-ADServiceAccount -Identity $SamAccountName
if($TestResult) {
Install-ADServiceAccount -Identity $SamAccountName
} else {
Write-Output "Cannot install gMSA`:$SamAccountName"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment