From df363ce38c36c2689707896e551fda74c5f3ea2c Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sat, 10 Aug 2024 15:23:38 +0200 Subject: [PATCH] Set user groups properly --- profiles/DerGeret/config.nix | 1 + scripts/Windows/OS/Install.ps1 | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/profiles/DerGeret/config.nix b/profiles/DerGeret/config.nix index b7c3ae8a..4c8926da 100644 --- a/profiles/DerGeret/config.nix +++ b/profiles/DerGeret/config.nix @@ -13,6 +13,7 @@ users.Manuel = { microsoftAccount = true; + groups = ["Administrators"]; }; }; diff --git a/scripts/Windows/OS/Install.ps1 b/scripts/Windows/OS/Install.ps1 index b875382d..abe191de 100644 --- a/scripts/Windows/OS/Install.ps1 +++ b/scripts/Windows/OS/Install.ps1 @@ -527,6 +527,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) {