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 = {
microsoftAccount = true;
groups = ["Administrators"];
};
};

View file

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