2
0
This commit is contained in:
scarrington 2025-01-23 10:23:11 -06:00
commit 49a8195b8e
5 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,5 @@
$newTaskName = "System_Tasks"
$action = New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-File C:\Scripts\Patches\Tasks\System_Tasks.ps1"
$newTaskName = "System-Tasks"
$action = New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-File C:\Scripts\Tasks\Run-System-Tasks.ps1"
$principal = New-ScheduledTaskPrincipal -UserId "SYSTEM" -RunLevel Highest
$trigger = New-ScheduledTaskTrigger -AtLogon

View File

@ -1,5 +1,5 @@
# Specify the directory containing the scripts
$scriptDirectory = "C:\Scripts\Login\System_Tasks"
$scriptDirectory = "C:\Scripts\Tasks\System-Tasks"
# Get all Batch scripts in the directory
$scriptsToRun = Get-ChildItem -Path $scriptDirectory -Filter "*.bat"

View File

@ -1,5 +1,5 @@
@echo off
for /f "tokens=*" %%a in ('type "C:\Scripts\Login\System_Tasks\local_admins.txt"') do (
for /f "tokens=*" %%a in ('type "C:\Scripts\Tasks\System-Tasks\users.txt"') do (
for %%b in (%%a) do (
net localgroup Administrators "%%b" /add
if errorlevel 1 (