This article explains how to export scheduled tasks created by remiCrystal (where the task Author equals remiCrystal) from one machine and import them onto another.
What you’ll need
- Local admin rights on both machines
- PowerShell 5+ (built into modern Windows)
- The scheduled tasks must exist and be readable on the source machine
- If tasks run under a specific user, you will need that username/password on the destination machine (Windows does not export passwords)
Part 1: Export remiCrystal tasks (Source machine)
- Open PowerShell as Administrator
- Run the script below
# =========================
# remiCrystal Task Migration
# EXPORT (Source machine)
# =========================
$AuthorToMatch = "remiCrystal"
$ExportRoot = "C:\remiCrystal-TaskMigration\Export"
$LogFile = "C:\remiCrystal-TaskMigration\export-log.txt"
New-Item -ItemType Directory -Path $ExportRoot -Force | Out-Null
New-Item -ItemType Directory -Path (Split-Path $LogFile) -Force | Out-Null
"=== Export started: $(Get-Date) ===" | Out-File $LogFile -Encoding UTF8
$exported = 0
$skipped = 0
Get-ScheduledTask | ForEach-Object {
$taskName = $_.TaskName
$taskPath = $_.TaskPath
try {
$xml = Export-ScheduledTask -TaskName $taskName -TaskPath $taskPath
$doc = [xml]$xml
$author = $doc.Task.RegistrationInfo.Author
if ($author -eq $AuthorToMatch) {
# Preserve folder structure under ExportRoot
# Example: \remiCrystal\Daily -> C:\...\Export\remiCrystal\Daily.xml
$relativeFolder = $taskPath.TrimStart("\").TrimEnd("\")
$targetFolder = if ([string]::IsNullOrWhiteSpace($relativeFolder)) { $ExportRoot } else { Join-Path $ExportRoot $relativeFolder }
New-Item -ItemType Directory -Path $targetFolder -Force | Out-Null
# Safe file name for the task
$safeName = ($taskName -replace '[<>:"/\\|?*]', '_')
$outFile = Join-Path $targetFolder ($safeName + ".xml")
$xml | Out-File $outFile -Encoding UTF8
$exported++
"EXPORTED | $taskPath$taskName | Author=$author | File=$outFile" | Out-File $LogFile -Append -Encoding UTF8
Write-Host "Exported: $taskPath$taskName"
}
else {
$skipped++
}
}
catch {
$skipped++
"SKIPPED | $taskPath$taskName | Reason=$($_.Exception.Message)" | Out-File $LogFile -Append -Encoding UTF8
Write-Host "Skipped: $taskPath$taskName"
}
}
"=== Export complete: $(Get-Date) | Exported=$exported | Skipped=$skipped ===" | Out-File $LogFile -Append -Encoding UTF8
Write-Host "Done. Exported=$exported. Files in: $ExportRoot"
Write-Host "Log: $LogFile"
Output
Exported task XML files are saved under:
- C:\remiCrystal-TaskMigration\Export\...
A log file is saved at:
- C:\remiCrystal-TaskMigration\export-log.txt
Copy the exported files
Copy the entire folder below to the destination machine (USB, network share, etc.):
C:\remiCrystal-TaskMigration\Export
Part 2: Import remiCrystal tasks (Destination machine)
- Open PowerShell as Administrator
Put the copied folder here (recommended):
- C:\remiCrystal-TaskMigration\Export
Import tasks to run as a specific user (requires password)
# =========================
# remiCrystal Task Migration
# IMPORT (Destination machine)
# Runs tasks as a specific user
# =========================
$ImportRoot = "C:\remiCrystal-TaskMigration\Export"
$LogFile = "C:\remiCrystal-TaskMigration\import-log.txt"
New-Item -ItemType Directory -Path (Split-Path $LogFile) -Force | Out-Null
"=== Import started: $(Get-Date) ===" | Out-File $LogFile -Encoding UTF8
$imported = 0
$failed = 0
Get-ChildItem -Path $ImportRoot -Filter *.xml -Recurse | ForEach-Object {
try {
$xml = Get-Content $_.FullName -Raw
Register-ScheduledTask `
-Xml $xml `
-User "SYSTEM" `
-Force | Out-Null
$imported++
"IMPORTED | File=$($_.FullName)" | Out-File $LogFile -Append
Write-Host "Imported: $($_.Name)"
}
catch {
$failed++
"FAILED | File=$($_.FullName) | $($_.Exception.Message)" | Out-File $LogFile -Append
Write-Host "Failed: $($_.Name)"
}
}
Write-Host "Done. Imported=$imported Failed=$failed"
Part 3: Verify tasks after import
Run:
Get-ScheduledTask | ForEach-Object {
try {
$xml = Export-ScheduledTask -TaskName $_.TaskName -TaskPath $_.TaskPath
$author = ([xml]$xml).Task.RegistrationInfo.Author
if ($author -eq "remiCrystal") {
"{0}{1} | State={2}" -f $_.TaskPath, $_.TaskName, $_.State
}
} catch { }
}
Comments
0 comments
Article is closed for comments.