Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Windows Task Scheduler® jobs can be migrated to JobSchedulerJS7.
  • SOS provides a PowerShell script that creates JobScheduler job configuration files JS7 workflows, calendars and schedules from Windows Task Scheduler® jobs.

...

  • Download the PowerShell cmdlet: ConvertFrom-WindowsTaskScheduler.ps1
  • The PowerShell cmdlet can be used with Windows PowerShell FullCLR 5.1 and PowerShell CoreCLR 6.x and 7.x for Windows environments. It can be used for JobScheduler JS7 releases 1.12 and 1.13.2.x.

Name

ConvertFrom-WindowsTaskScheduler

...

Converts jobs from the Windows Task Scheduler Scheduler® to JobSchedulerJS7.

SYNTAX

ConvertFrom-WindowsTaskScheduler [-AgentName <String>] [[-TaskName] <String>] [[-TaskPath] <String>] [[-OutputDirectory] <String>] [[-Timezone] <String>]  [<CommonParameters>]

...

The job configuration from the Windows Task Scheduler Scheduler® is converted to XML job files which JSON files holding workflows, calendars and schedules that can be imported and deployed to a JobScheduler MasterJS7.

The cmdlet script writes XML job JSON files to an output directory . You can copy such files to the JobScheduler Master's ./config/live folder to deploy your jobs.and creates a .zip archive for import to the JS7. Users can import and deploy workflows, schedules and calendars.

JSON XML job file names are created from the Windows Task Scheduler folder paths and Scheduler® task names.

PARAMETERS

AgentName

-AgentName <String>

Specifies the name of an Agent that should execute the converted jobs. Typically this will be an Agent running on the Windows machine from which jobs are converted.

Required?true
Position?1
Default value
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

TaskName

-TaskName <String>

Specifies an individual job to be converted. Note that job names are not unique with Windows Task SchedulerScheduler®. When used with the -TaskPath parameter then a single job can be selected.

Without this parameter all jobs are converted.

Required?false
Position?12
Default value
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

...

Specifies the path in the Windows Task Scheduler Scheduler® repository from which jobs should be converted.

Without this parameter jobs from all paths are converted.

Required?false
Position?23
Default value
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

...

Specifies the output directory for converted jobs.

If the directory does is not exist then it will be created. By default the working directory is usedspecified then a temporary directory is created and is removed after conversion of jobs.

Required?false
Position?34
Default value
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

...

Accepts the name of a Joda time zone, see http://joda-time.sourceforge.net/timezones.html
The cmdlet script does not convert dates according to this time zone, instead the specified time zone is added to the run-time settings of jobsworkflows and schedules. Note that a JobScheduler Master might JS7 Controller, Agents and JOC Cockpit can be operated in a time zone that is different to from the time zone that the Windows Task Scheduler Scheduler® is operated for.

Required?false
Position?45
Default value
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

...

PS > ConvertFrom-WindowsTaskScheduler -AgentName windowsAgent -TaskPath \Microsoft\Windows\Defrag\ -TaskName ScheduledDefrag -OutputDirectory ArchivePath C:/tmp/jobsjs7-import.zip

Converts the job job ScheduledDefrag from the specified folder and writes the XML job file to the cJSON files to a temporary directory that is added to the C:/tmp/jobs directoryjs7-import.zip archive for import in JS7.

-------------------------- EXAMPLE 2 --------------------------

PS > ConvertFrom-WindowsTaskScheduler -AgentName windowsAgent -TaskPath \ -OutputDirectory C:/tmp/jobs -ArchivePath C:/tmp/jobsjs7-import.zip

Converts jobs available in the root folder of Windows Task Manager Scheduler® and writes the XML job file JSON files to the c:/tmp/jobs directory that is added to the indicated .zip archive.

-------------------------- EXAMPLE 3 --------------------------

PS > ConvertFrom-WindowsTaskScheduler -AgentName windowsAgent -TaskName ScheduledDefrag -OutputDirectory C:/tmp/jobs

Converts job(s) with the given name from any folder and writes the XML job file(s) JSON files to the c:/tmp/jobs directory that is implicitly added to the js7-import.zip archive file in the working directory.

-------------------------- EXAMPLE 4 --------------------------

PS > ConvertFrom-WindowsTaskScheduler -AgentName windowsAgent -Timezone 'Europe/London' -OutputDirectory C:/tmp/jobs -ArchivePath C:/tmp/jobsjs7-import.zip

Converts all jobs from any folders and writes the XML job JSON files to the c:/tmp/jobs directory that is added to the C:/tmp/js7-import.zip archive file for import in JS7.
The specified Joda time zone is added to the run-time settings workflows and schedules of converted jobs.

Limitations

  • Triggers for monthly job execution are not converted as there is no public API for this trigger type.
  • Actions of Windows Task Scheduler Scheduler® jobs are mapped to a single JobScheduler JS7 job script.
  • For cyclic jobs in JobSchedulerJS7, repetitions have to occur within a 24 hours period. Windows Task Scheduler Scheduler® knows about repetitions that exceed this period.

...