PowerShell Genie

New-ScheduledTaskTrigger

Use New-ScheduledTaskTrigger to define when a scheduled task runs — daily at 3am, every Monday, at logon, or at startup — then register it with Register-ScheduledTask.

Command 5 min read PowerShell 7 on Windows

Documentation: Microsoft Learn — new-scheduledtasktrigger

Syntax

1PS> New-ScheduledTaskTrigger -Daily [-At <DateTime>] [-DaysInterval <UInt32>] [<CommonParameters>]
2PS> New-ScheduledTaskTrigger -Weekly [-DaysOfWeek <DayOfWeek[]>] [-At <DateTime>] [-WeeksInterval <UInt32>] [<CommonParameters>]
3PS> New-ScheduledTaskTrigger -Once -At <DateTime> [<CommonParameters>]
4PS> New-ScheduledTaskTrigger -AtLogOn [<CommonParameters>]
5PS> New-ScheduledTaskTrigger -AtStartup [<CommonParameters>]

Try it

Windows PowerShell

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.

Interactive simulation · fictional data

Examples

Trigger a task daily at 3am

1PS> $trigger = New-ScheduledTaskTrigger -Daily -At 3am $trigger
Show reference output

Illustrative output · values vary by environment

Id                   : 
TriggerType          : Time
StartBoundary        : 2026-10-25T03:00:00
DaysInterval         : 1
Enabled              : True

Trigger a task every Monday and Friday

1PS> $trigger = New-ScheduledTaskTrigger -Weekly -DaysOfWeek Monday, Friday -At 6pm
Show reference output

Illustrative output · values vary by environment

TriggerType          : Weekly
DaysOfWeek           : Monday, Friday
StartBoundary        : 2026-10-25T18:00:00

Create a complete scheduled task end to end

1PS> $action = New-ScheduledTaskAction -Execute 'powershell.exe' -Argument '-File C:\Scripts\backup.ps1' $trigger = New-ScheduledTaskTrigger -Daily -At 2am Register-ScheduledTask -TaskName 'Nightly backup' -Action $action -Trigger $trigger -Description 'Backs up the database every night'
Show reference output

Illustrative output · values vary by environment

TaskPath  TaskName        State
--------  --------        -----
\         Nightly backup  Ready

Parameters

Parameter definitions:

  • -Daily — Runs every day, or every N days with -DaysInterval.
  • -Weekly — Runs on chosen days of the week with -DaysOfWeek.
  • -Once — Runs a single time at the -At date and time.
  • -AtLogOn — Runs when any user, or a specified user, logs on.
  • -AtStartup — Runs when the computer starts.
  • -At — The time of day, or the full date and time for -Once.
  • -DaysInterval / -WeeksInterval — Repeat every N days or weeks instead of every day or week.
  • -RandomDelay — Adds a random delay up to the given timespan, so a fleet of machines does not all run at once.

Microsoft Learn — new-scheduledtasktrigger

A trigger alone is not a task

New-ScheduledTaskTrigger only builds a trigger object in memory. Nothing is scheduled until you pass it to Register-ScheduledTask together with an action from New-ScheduledTaskAction. A script that creates a trigger and exits has scheduled nothing.

Tasks that run while nobody is logged on need a stored credential or the SYSTEM account. Register with -User 'SYSTEM' for machine jobs, or pass -User and -Password for a service account. A task registered under your account without a stored password runs only while you are logged on.

Times are local time, and daylight-saving changes shift them. A 2am task runs twice on the autumn clock change and not at all on the spring change. For jobs that must run exactly once a day, pick a time far from 2am.

Register the task with Register-ScheduledTask

List tasks with Get-ScheduledTask

Run a task on demand with Start-ScheduledTask

Updated 25 October 2026. Browser outputs are fictional; check the installed module help for your environment.

Recap

New-ScheduledTaskTrigger Use New-ScheduledTaskTrigger to define when a scheduled task runs — daily at 3am, every Monday, at logon, or at startup — then register it with Register-ScheduledTask.

Next: Invoke Gpupdate
Genie guideNew-ScheduledTaskTrigger

New-ScheduledTaskTrigger builds the schedule for a scheduled task: daily, weekly, once, at logon, or at startup. Combine it with New-ScheduledTaskAction and Register-ScheduledTask to create a task entirely from PowerShell. The console below is pre-loaded — run it, then change a value and run it again.