Disable scheduled task registration

This commit is contained in:
Manuel Thalmann 2023-06-28 22:07:18 +02:00
parent 2b1b9cb449
commit 94a5f09aa4

View file

@ -52,8 +52,7 @@ function Enable-UACNextLogin() {
" ",
@(
"-c",
"Set-ItemProperty `"$keyPath`" -Name `"$propertyName`" -Value 0;",
"Unregister-ScheduledTask -Force $taskName;")));
"Set-ItemProperty `"$keyPath`" -Name `"$propertyName`" -Value 0;")));
$trigger = New-ScheduledTaskTrigger -AtLogOn;
$principal = New-ScheduledTaskPrincipal -UserId "SYSTEM" -RunLevel Highest;