From a122795f38837df491b68939642b30a038a12a15 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Fri, 30 Jun 2023 03:40:04 +0200 Subject: [PATCH] Set proper boundaries for event numbers --- scripts/Windows/OS/User.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/Windows/OS/User.ps1 b/scripts/Windows/OS/User.ps1 index 70cc07fb..7c02ddc7 100644 --- a/scripts/Windows/OS/User.ps1 +++ b/scripts/Windows/OS/User.ps1 @@ -78,8 +78,8 @@ function Set-UACState([bool] $value) { function Enable-UACNextLogin([Context] $context) { Set-UACState $true; $tempTask = "PortValhalla Temp"; - $autoLoginTrigger = Get-Random; - $uacDisablerTrigger = Get-Random; + $autoLoginTrigger = Get-Random -Maximum 65535; + $uacDisablerTrigger = Get-Random -Maximum 65535; $key = Get-SystemPolicyKey; $context.Set($autoLoginTriggerProperty, $autoLoginTrigger, "DWord");