Prevent future auto logins

This commit is contained in:
Manuel Thalmann 2023-06-22 23:04:13 +02:00
parent 2365d3320c
commit 686251b0f7
2 changed files with 2 additions and 1 deletions

View file

@ -18,6 +18,6 @@ function New-PersonalUser([Context] $context)
$user = Get-LocalUser | Select-Object { -not ($users -contains $_.Name) } | Select-Object -Last;
Rename-LocalUser $user $context.UserName;
Add-LocalGroupMember -Group "Administrators" -Member $user;
Add-LocalGroupMember -Group "Administrators" -Member $user && Set-LocalUser $context.AdminName -Password (ConvertTo-SecureString "Admin");
}
}

View file

@ -3,6 +3,7 @@ class Context {
[string]$RootDir;
[string]$BackupName;
[string]$UserName;
[string]$AdminName = "Admin";
[string] BackupRoot() {
if (-not $this.RootDir)
{