Register-ScheduledTask
Use Register-ScheduledTask to create a scheduled task from action, trigger, principal and settings objects.
Documentation: Microsoft Learn — PowerShell module reference
Syntax
See the command anatomy
Read the command and its supplied arguments. This example requires real PowerShell or its module; this diagram does not execute it.
Register-ScheduledTask [-TaskName] <String> [-TaskPath <String>] [-Action <CimInstance[]>] [-Trigger <CimInstance[]>] [-Principal <CimInstance>] [-Settings <CimInstance>] [-User <String>] [-Password <String>] [-RunLevel <RunLevelEnum>] [-Force] [<CommonParameters>]- Stage 1Register-ScheduledTask
-TaskName -TaskPath -Action -Trigger -Principal -Settings -User -Password -RunLevel -Force
Try it
PowerShell example · browser support is limited.
Execution scope: The full example below requires PowerShell outside this browser. You can edit this runner to use the supported practice commands; unsupported syntax returns an explanation.
Follow the objects
Run the command to inspect each stage.
Examples
Register-ScheduledTask -Execute pwsh.exe
Show reference output
Sample output · fictional data, shaped like the real thing
TaskPath TaskName State -------- -------- ----- \ Backup Ready
Register-ScheduledTask -Execute pwsh.exe (2)
Show reference output
Sample output · fictional data, shaped like the real thing
TaskPath TaskName State -------- -------- ----- \ Backup Ready
Register-ScheduledTask -UserId SYSTEM
Show reference output
Sample output · fictional data, shaped like the real thing
TaskPath TaskName State -------- -------- ----- \ Backup Ready
Parameters
Parameter definitions:
-TaskName-TaskPath-Action-Trigger-Principal-Settings-User-Password-RunLevel-Force
Practical use and troubleshooting
Practical scenario: Use Register-ScheduledTask when you need to create a scheduled task from action, trigger, principal and settings objects. Start with one identified target and inspect the returned values before extending the operation to a list. Keep the identity in your report so you can trace each result back to the object or path that produced it.
Common error and fix: A task that registers but fails later may use a missing executable or incorrect working directory. Supply an absolute action path and inspect its runtime result under the task's configured account. In an unattended script, capture this failure with its original error record and record which target failed. An empty result and an unsuccessful query must remain distinguishable in the final report.
See also: Get-ScheduledTask. Register-ScheduledTask registers a task definition; Get-ScheduledTask reads the registered configuration. Review the action, principal and trigger as separate parts of the task. Read the linked command before substituting it; similar names do not imply identical inputs or output.
Recap
Register-ScheduledTask Use Register-ScheduledTask to create a scheduled task from action, trigger, principal and settings objects.
Next: Start-ScheduledTask