Set user groups properly

This commit is contained in:
Manuel Thalmann 2024-08-10 15:23:38 +02:00
parent 4f2781b154
commit 3ad0fcf95e
2 changed files with 5 additions and 0 deletions

View file

@ -13,6 +13,7 @@
users.Manuel = { users.Manuel = {
microsoftAccount = true; microsoftAccount = true;
groups = ["Administrators"];
}; };
}; };

View file

@ -530,6 +530,10 @@ $null = New-Module {
$configure = { $configure = {
Deploy-SoftwareAction -Action ([InstallerAction]::ConfigureUser); Deploy-SoftwareAction -Action ([InstallerAction]::ConfigureUser);
Remove-LocalGroupMember -Member "$user" @adminGroup -ErrorAction SilentlyContinue; Remove-LocalGroupMember -Member "$user" @adminGroup -ErrorAction SilentlyContinue;
foreach ($group in Get-UserConfig -UserName "$user" "groups") {
Add-LocalGroupMember -Member "$user" -Name "$group";
}
} }
if ($msAccount) { if ($msAccount) {