2024-03-22 09:32:53 +00:00
|
|
|
#!/bin/pwsh
|
2024-03-23 00:27:49 +00:00
|
|
|
param (
|
|
|
|
[int]$EventID,
|
|
|
|
[string]$AutoLoginTaskName,
|
|
|
|
[string]$UACDisablerTaskName,
|
|
|
|
[string]$AutoLoginTriggerProperty,
|
|
|
|
[string]$UACDisablerTriggerProperty
|
|
|
|
);
|
2024-03-22 09:32:53 +00:00
|
|
|
|
2024-03-23 00:27:49 +00:00
|
|
|
. "$PSScriptRoot/../../Scripts/Context.ps1";
|
|
|
|
$context = [Context]::new();
|
|
|
|
$context.SetUACState($false);
|
2024-03-24 17:16:29 +00:00
|
|
|
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();
|