guide · static export
PC · scheduled-tasks

Move Your Scheduled Tasks to Another PC

Tasks are XML files, so they travel well — until a task references a user account or a path that does not exist on the new machine. Export, clean the traps, register and verify.

by@guidox updated:10/31/26 time:25 min level:Intermediate tested on:Windows 11 24H2 works on:Windows 10, Windows 11, Windows Server 2019 tools:PowerShell as administrator
TL;DR

Export with **Export-ScheduledTask** or **schtasks /query /xml**, edit the **UserId** and any absolute paths, then register with **Register-ScheduledTask -Xml**. Check the result with **Get-ScheduledTaskInfo**.

Before you start

Requirements

  • Admin rights on both PCs
  • The task's source scripts on the new PC
  • 25 minutes
Step by step

Instructions

01

List the tasks worth moving

**Get-ScheduledTask** shows only real tasks with their path and state. Ignoring the \Microsoft\Windows tree avoids moving operating system jobs that belong to the installation.

Get-ScheduledTask | Where-Object TaskPath -notlike '\Microsoft*' |
  Select-Object TaskName,TaskPath,State | Sort-Object TaskPath,TaskName | Format-Table -AutoSize
02

Export as XML, one file per task

The XML form is the only portable representation. **Export-ScheduledTask** writes it without the wrapper that schtasks adds when you redirect its output.

New-Item -ItemType Directory C:\TaskExport -Force | Out-Null
Get-ScheduledTask | Where-Object TaskPath -notlike '\Microsoft*' | ForEach-Object {
  Export-ScheduledTask -TaskName $_.TaskName -TaskPath $_.TaskPath |
    Set-Content -Path ("C:\TaskExport\{0}.xml" -f $_.TaskName) -Encoding UTF8
}
Get-ChildItem C:\TaskExport | Select-Object Name,Length
03

Read the XML for the two traps

**UserId** under Principal and every absolute path in Arguments decide whether the task runs at all. A task bound to S-1-5-21-... on the old machine is bound to nothing on the new one.

Select-String -Path C:\TaskExport\*.xml -Pattern '<UserId>|<Command>|<Arguments>|<WorkingDirectory>' |
  Select-Object Filename,Line | Format-Table -Wrap
⚠ warningA task that stores a password carries it in the XML only in encrypted form tied to the old machine. Those credentials must be re-entered on the new PC.
04

Register it with explicit credentials

**Register-ScheduledTask -Xml** restores triggers, conditions and actions. **-User** overrides the stale principal, and **-RunLevel Highest** keeps an elevated task elevated.

$xml = Get-Content C:\TaskExport\NightlyBackup.xml -Raw
Register-ScheduledTask -TaskName 'NightlyBackup' -TaskPath '\' -Xml $xml -User 'SYSTEM' -RunLevel Highest
Get-ScheduledTask -TaskName 'NightlyBackup' | Select-Object TaskName,State,@{n='User';e={$_.Principal.UserId}}
05

Start it once and read the result

A task that registers can still fail on its first run. **Get-ScheduledTaskInfo** returns LastRunTime, LastTaskResult and the next run, and 0x0 is the only success value.

Start-ScheduledTask -TaskName 'NightlyBackup'
Start-Sleep -Seconds 10
Get-ScheduledTaskInfo -TaskName 'NightlyBackup' | Select-Object LastRunTime,LastTaskResult,NextRunTime,NumberOfMissedRuns
06

Fix the two errors you will actually see

**0x2** means the file or path does not exist, **0x41303** means the task never ran. Both are path or trigger problems, not permission problems, and both are visible in the task's history.

Get-WinEvent -LogName 'Microsoft-Windows-TaskScheduler/Operational' -MaxEvents 20 |
  Where-Object Id -in 102,201,203 | Select-Object TimeCreated,Id,Message
Enable-ScheduledTask -TaskName 'NightlyBackup'
Troubleshooting

Common issues

Register fails with an XML error

The file contains a BOM or the content was wrapped by schtasks output redirection. Export again with Export-ScheduledTask and keep the encoding at UTF8.

The task runs but does nothing

The working directory is the difference. An action without -WorkingDirectory runs in C:\Windows\System32, so relative paths break.

The task asks for a password

It runs as a user with stored credentials. Use -User with Set-ScheduledTask, or switch the principal to SYSTEM if the task needs no network identity.

History shows nothing

The operational log is disabled by default on some builds. Enable it in Event Viewer under Applications and Services Logs, or trust LastTaskResult instead.

FAQ

Frequently asked

Can I move every task at once?

Yes, and you should not. Tasks that belong to Windows components are recreated by the installation and can break with an imported duplicate.

Do triggers keep their time zone?

Triggers are stored in local time. Moving a task to a machine in another zone shifts every start time.

How to undo this

Unregister the imported task with Unregister-ScheduledTask -TaskName 'NightlyBackup' -Confirm:$false. The original machine is untouched, so nothing else needs to be restored.

Changelog · 1 entry
  1. 2026-10-31
    First version
Interactive version: checklist, feedback, related guides →

Free · no account needed · tracks your progress