Exclude the Guest user

This commit is contained in:
Manuel Thalmann 2023-06-23 02:34:53 +02:00
parent 706b78d9cf
commit 1eb8875757

View file

@ -15,7 +15,9 @@ function New-PersonalUser([Context] $context)
"So sorry...")); "So sorry..."));
$users = Get-LocalUser | Select-Object { $_.Name }; $users = Get-LocalUser | Select-Object { $_.Name };
$users += @("WDAGUtilityAccount"); Write-Host "Following users exist already:"
Write-Host $users;
$users += @("WDAGUtilityAccount", "User");
Read-Host "Please hit enter once you're done..."; Read-Host "Please hit enter once you're done...";
$user = Get-LocalUser | Where-Object { -not ($users -contains $_.Name) } | Select-Object -Last 1; $user = Get-LocalUser | Where-Object { -not ($users -contains $_.Name) } | Select-Object -Last 1;