From 0ba664eb5142312a3010fe4e5d45d3775f3c8ce8 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Fri, 23 Jun 2023 20:16:47 +0200 Subject: [PATCH] Make the script start for all new users --- scripts/Windows/OS/User.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/Windows/OS/User.ps1 b/scripts/Windows/OS/User.ps1 index e67bbd97..f711ae0b 100644 --- a/scripts/Windows/OS/User.ps1 +++ b/scripts/Windows/OS/User.ps1 @@ -28,8 +28,12 @@ function New-PersonalUser([Context] $context) } } + Write-Information "Renaming the new User to $($context.UserName)"; Rename-LocalUser $user $context.UserName; 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; } }