Page History
...
Converts jobs from the Windows Task Scheduler® to JS7.
SYNTAX
ConvertFrom-WindowsTaskScheduler [-AgentName <String>] [[-TaskName] <String>] [[-TaskPath] <String>] [[-OutputDirectory] <String>] [[-ArchivePath] <String>] [[-CalendarName] <String>] [[-Timezone] <String>] [<CommonParameters>]
...
The job configuration from Windows Task Scheduler® is converted to JSON files holding workflows, calendars and schedules which can be imported and deployed to JS7.
The script writes JSON files to an output directory and creates a .zip archive for import to JS7. Users can import and deploy workflows, schedules and calendars.
JSON This includes to create a workflow JSON file and a schedule JSON file per converted job. JSON file names are created from the Windows Task Scheduler® task names.
The cmdlet adds JSON files to a .zip archive which can be imported to JS7.
PARAMETERS
AgentName
-AgentName <String>
...
Required? | false |
Position? | 4 |
Default value | |
Accept pipeline input? | true (ByPropertyName) |
Accept wildcard characters? | false |
CalendarName
-CalendarName <String>
Specifies the name of a common calendar for converted jobs in the JS7 inventory. All converted jobs use the same calendar.
If the directory is not specified then a temporary directory is created and is removed after conversion of jobs.
Required? | false |
Position? | 5 |
Default value | EveryDay |
Accept pipeline input? | true (ByPropertyName) |
Accept wildcard characters? | false |
Timezone
-Timezone <String>
Accepts the name of a Joda time zone, see http://joda-time.sourceforge.net/timezones.html
The script does not convert dates according to this time zone, instead the specified time zone is added to added to the run-time settings of workflows and schedulesjobs. Note Consider that the JS7 Controller, Agents and JOC Cockpit can JS7 might be operated in a time zone which zone which is different to from the time zone that the Windows Task Scheduler® is operated infor.
Required? | false |
Position? | 56 |
Default value | |
Accept pipeline input? | true (ByPropertyName) |
Accept wildcard characters? | false |
...
-------------------------- EXAMPLE 1 --------------------------
PS > ConvertFrom> ./ConvertFrom-WindowsTaskScheduler.ps1 -AgentName windowsAgent -TaskPath \Microsoft\Windows\Defrag\ -TaskName ScheduledDefrag -ArchivePath OutputDirectory C:/tmp/js7-import.zipjobs
Converts the job ScheduledDefrag
job from the specified folder path and writes the JSON files to a temporary directory which is added to the the C:/tmp/jobs
directory. Converted jobs are available for import from the default archive file js7-import.zip
archive for import into JS7 in the current directory.
-------------------------- EXAMPLE 2 --------------------------
PS > ConvertFrom> ./ConvertFrom-WindowsTaskScheduler.ps1 -AgentName windowsAgent -TaskPath \ -OutputDirectory C:/tmp/jobs -ArchivePath C:/tmp/js7-import.zipjobs
Converts jobs available in the root folder of Windows Task Scheduler® and writes the JSON files to the cC:/tmp/jobs
directory which is added to the indicated .zip archive.
-------------------------- EXAMPLE 3 --------------------------
PS > ConvertFrom> ./ConvertFrom-WindowsTaskScheduler.ps1 -AgentName windowsAgent -TaskName ScheduledDefrag Timezone 'Europe/London' -CalendarName DailyCalendar -OutputDirectory C:/tmp/jobs
Converts job(s) with the given name all jobs from any folder folders and writes the JSON files to the cC:/tmp/jobs
directory which is implicitly . The specified Joda time zone is added to the js7-import.zip
archive file in the working directoryrun-time settings of converted jobs. The specified calendar is created and assigned the converted jobs.
-------------------------- EXAMPLE 4 --------------------------
PS > ConvertFrom> ./ConvertFrom-WindowsTaskScheduler.ps1 -AgentName windowsAgent -Timezone 'Europe/London' -OutputDirectory ArchivePath C:/tmp/jobs -ArchivePath js7-import.zip -OutputDirectory C:/tmp/js7-import.zipjobs
Converts all jobs from all folders and writes the JSON files to the cC:/tmp/jobs
directory which is added to the . Converted jobs are available from the C:/tmp/js7-import.zip
archive file for import into JS7.
The specified Joda time zone is added to the workflows and schedules of converted jobs.
Limitations
...
- Actions of Windows Task Scheduler® jobs are mapped to a single JS7 job script.
- For cyclic jobs in JS7, repetitions have to occur within a 24 hours period. Windows Task Scheduler® knows about repetitions that exceed this period.
...