Created
November 4, 2020 16:01
-
-
Save roberttoups/6b86b0a89164ba7c138641529829c94d to your computer and use it in GitHub Desktop.
Install a Group Managed Service Account on a Windows system
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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