17 lines
565 B
PowerShell
17 lines
565 B
PowerShell
#!/bin/pwsh
|
|
param (
|
|
[int]$EventID,
|
|
[string]$AutoLoginTaskName,
|
|
[string]$UACDisablerTaskName,
|
|
[string]$AutoLoginTriggerProperty,
|
|
[string]$UACDisablerTriggerProperty
|
|
);
|
|
|
|
. "$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";
|
|
$context.Remove($UACDisablerTriggerProperty);
|
|
$context.DeregisterNewUserReboot();
|