Make the script start for all new users

This commit is contained in:
Manuel Thalmann 2023-06-23 20:16:47 +02:00
parent 95981f4d3c
commit 0ba664eb51

View file

@ -28,8 +28,12 @@ function New-PersonalUser([Context] $context)
} }
} }
Write-Information "Renaming the new User to $($context.UserName)";
Rename-LocalUser $user $context.UserName; Rename-LocalUser $user $context.UserName;
Add-LocalGroupMember -Group "Administrators" -Member $user && Set-LocalUser $context.AdminName -Password (ConvertTo-SecureString -AsPlainText "Admin"); Add-LocalGroupMember -Group "Administrators" -Member $user && Set-LocalUser $context.AdminName -Password (ConvertTo-SecureString -AsPlainText "Admin");
$context.Reboot();
Write-Host "Registering setup script for all new users";
$context.RegisterNewUserReboot();
Register-Reboot;
} }
} }