PortValhalla/scripts/Windows/OS/User/UACDisabler.ps1

17 lines
565 B
PowerShell
Raw Normal View History

#!/bin/pwsh
2024-03-23 00:27:49 +00:00
param (
[int]$EventID,
[string]$AutoLoginTaskName,
[string]$UACDisablerTaskName,
[string]$AutoLoginTriggerProperty,
[string]$UACDisablerTriggerProperty
);
2024-03-23 00:27:49 +00:00
. "$PSScriptRoot/../../Scripts/Context.ps1";
$context = [Context]::new();
$context.SetUACState($false);
Unregister-ScheduledTask -Confirm:$false $UACDisablerTaskName;
Write-EventLog -LogName Application -Source "Application" -EventId $EventID -Message "This event was created by $env:Username";
2024-03-23 00:27:49 +00:00
$context.Remove($UACDisablerTriggerProperty);
$context.DeregisterNewUserReboot();