This commit is contained in:
Manuel Thalmann 2023-06-30 03:38:18 +02:00
parent a26e53a4a7
commit 3200438721

View file

@ -6,7 +6,7 @@ $uacDisablerTriggerProperty = "UACDisablerTrigger";
function New-PersonalUser([Context] $context)
{
if (-not (Get-LocalUser $context.UserName))
if (-not (Get-LocalUser $context.UserName -ErrorAction SilentlyContinue))
{
Write-Host "Creating Personal User";
@ -144,6 +144,6 @@ function Enable-PersonalUserAutologon([Context] $context)
}
$context.Set($preparedUsernameProperty, $context.UserName, "ExpandString");
$context.Set($preparedUsernameProperty, $password, "ExpandedString");
$context.Set($preparedUsernameProperty, $password, "ExpandString");
Write-EventLog -LogName Application -Source "Application" -EventId $context.Get($autoLoginTriggerProperty) -Message "This event was created by $env:Username";
}