Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Param(
- $userAccount = "NT AUTHORITY\SYSTEM",
- $exePath = "C:\Code\SampleTaskConsole\bin\Debug\SampleTaskConsole.exe",
- $taskName = "ScormCloudReporting"
- )
- Unregister-ScheduledTask -TaskName $taskName -Confirm:$false -ErrorAction SilentlyContinue
- $action = New-ScheduledTaskAction -Execute $exePath
- $trigger = New-ScheduledTaskTrigger -Daily -At 1am
- $principal = New-ScheduledTaskPrincipal -UserID $userAccount -LogonType ServiceAccount -RunLevel Highest
- Register-ScheduledTask -Action $action -Trigger $trigger -TaskName $taskName -Description $taskName -Principal $principal
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement