never expire password

This commit is contained in:
Jonas Leder 2024-08-03 22:19:24 +02:00
commit 494661eaff

View file

@ -10,7 +10,7 @@ func SetUserPassword(username string, password string) {
psCmd := fmt.Sprintf(`
$username = "%s"
$password = ConvertTo-SecureString "%s" -AsPlainText -Force
Set-LocalUser -Name $username -Password $password
Set-LocalUser -Name $username -Password $password -PasswordNeverExpires 1
`, username, password)
// Execute PowerShell command