Restructured Tasks
This commit is contained in:
parent
4acbb76829
commit
79e1953aba
@ -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
|
||||
|
||||
|
||||
@ -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"
|
||||
@ -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 (
|
||||
Loading…
x
Reference in New Issue
Block a user