Scheduled Tasks
PowerShell ScheduledTasks Module
Its been a while since I have done a writeup, and after spending a few days working with PowerShell and Scheduled Tasks, its time to get some work done. The goal of this writeup is to detail how to make a Scheduled Task using PowerShell and to run these Tasks as a Standard User with the SYSTEM account. A good start is to link to Microsoft's official word on the ScheduledTasks Module
ScheduledTasks Module
docsmsft

A Simple Task

Microsoft has some basic examples on how to create a Scheduled Task, so here is the example they give. I strongly recommend understanding how this is done before going forward to the next article
1
PS C:\> $A = New-ScheduledTaskAction -Execute "Taskmgr.exe"
2
PS C:\> $T = New-ScheduledTaskTrigger -AtLogon
3
PS C:\> $P = New-ScheduledTaskPrincipal "Contoso\Administrator"
4
PS C:\> $S = New-ScheduledTaskSettingsSet
5
PS C:\> $D = New-ScheduledTask -Action $A -Principal $P -Trigger $T -Settings $S
6
PS C:\> Register-ScheduledTask T1 -InputObject $D
Copied!
New-ScheduledTask (ScheduledTasks)
docsmsft

Adam The Automator

Probably the best written PowerShell and Scheduled Tasks article is from June Castillote and posted at the following link. Give it a read, and give June a Twitter follow!
How to Set Up and Manage Scheduled Tasks with PowerShell
Adam the Automator
Last modified 8mo ago