You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Name

Get-JobSchedulerTaskHistory

SYNOPSIS

Returns the task execution history for jobs.

SYNTAX

Get-JobSchedulerTaskHistory [[-Job] <String>] [[-JobChain] <String>] [[-OrderId] <String>] [[-Directory] <String>] [-Recursive] [[-State] <String>] [[-DateFrom] <DateTime>] [[-DateTo] <DateTime>] [[-Timezone] <TimeZoneInfo>] [[-Limit] <Int32>] [-Successful] [-Failed] [-Incomplete] [<CommonParameters>]

DESCRIPTION

History information is returned for jobs from a JobScheduler Master.
Task executions can be selected by job name, folder, history status etc.

The history information retured includes start time, end time, return code etc.

PARAMETERS

Job

-Job <String>
Optionally specifies the path and name of a job.
If the name of a job is specified then the -Directory parameter is used to determine the folder.
Otherwise the -Job parameter is assumed to include the full path and name of the job.

One of the parameters -Directory, -JobChain or -Job has to be specified.

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

JobChain

-JobChain <String>
Optionally specifies the path and name of a job chain that includes jobs.
If the name of a job chain is specified then the -Directory parameter is used to determine the folder.
Otherwise the -JobChain parameter is assumed to include the full path and name of the job chain.

One of the parameters -Directory, -JobChain or -Job has to be specified.

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

OrderId

-OrderId <String>
Optionally specifies the identifier of an order to limit results to jobs that
correspond to the order's current state.

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

Directory

-Directory <String>
Optionally specifies the folder for which jobs should be returned. The directory is determined
from the root folder, i.e. the "live" directory.

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

Recursive

-Recursive <SwitchParameter>
Specifies that any sub-folders should be looked up when used with the -Directory parameter.
By default no sub-folders will be looked up for jobs.

Required?false
Position?named
Default valueFalse
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

State

-State <String>
Specifies that only jobs are considered that an order is currently passing. This is identified by the
order's state attribute that corresponds to the job node's state attribute.
This parameter requires use of the -JobChain parameter. If used with the -Order parameter then
only jobs for that order are considered, otherwise jobs for any orders in the given job chain are considered.

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

DateFrom

-DateFrom <DateTime>
Specifies the date starting from which history items should be returned.
Consider that a UTC date has to be provided.

Default: Begin of the current day as a UTC date

Required?false
Position?6
Default value(Get-Date -Hour 0 -Minute 0 -Second 0).ToUniversalTime()
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

DateTo

-DateTo <DateTime>
Specifies the date until which history items should be returned.
Consider that a UTC date has to be provided.

Default: End of the current day as a UTC date

Required?false
Position?7
Default value(Get-Date -Hour 0 -Minute 0 -Second 0).AddDays(1).ToUniversalTime()
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

Timezone

-Timezone <TimeZoneInfo>
Specifies the timezone to which dates should be converted in the history information.
A timezone can e.g. be specified like this:

Get-JSTaskHistory -Timezone (Get-Timezone -Id 'GMT Standard Time')

All dates in JobScheduler are UTC and can be converted e.g. to the local time zone like this:

Get-JSTaskHistory -Timezone (Get-Timezone)

Default: Dates are returned in UTC.

Required?false
Position?8
Default value(Get-Timezone -Id 'UTC')
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

Limit

-Limit <Int32>
Specifies the max. number of history items of task executions to be returned.
The default value is 10000, for an unlimited number of items the value -1 can be specified.

Required?false
Position?9
Default value0
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

Successful

-Successful <SwitchParameter>
Returns history information for successfully executed tasks.

Required?false
Position?named
Default valueFalse
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

Failed

-Failed <SwitchParameter>
Returns history informiaton for failed tasks.

Required?false
Position?named
Default valueFalse
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

Incomplete

-Incomplete <SwitchParameter>
Specifies that history information for running tasks should be returned.

Required?false
Position?named
Default valueFalse
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

about_jobscheduler

EXAMPLES

-------------------------- EXAMPLE 1 --------------------------

PS > $items = Get-JobSchedulerTaskHistory

Returns today's task execution history for any jobs.

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

PS > $items = Get-JobSchedulerTaskHistory -Timezone (Get-Timezone)

Returns today's task execution history for any jobs with dates being converted to the local timezone.

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

PS > $items = Get-JobSchedulerTaskHistory -Timezone (Get-Timezone -Id 'GMT Standard Time')

Returns today's task execution history for any jobs with dates being converted to the GMT timezone.

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

PS > $items = Get-JobSchedulerTaskHistory -Job /test/globals/job1

Returns today's task execution history for a given job.

-------------------------- EXAMPLE 5 --------------------------

PS > $items = Get-JobSchedulerTaskHistory -JobChain /test/globals/job_chain1

Returns today's task execution history for jobs in the given job chain.

-------------------------- EXAMPLE 6 --------------------------

PS > $items = Get-JobSchedulerTaskHistory -Failed -DateFrom (Get-Date -Hour 0 -Minute 0 -Second 0).AddDays(-7).ToUniversalTime()

Returns the task execution history for any failed jobs for the last seven days.

-------------------------- EXAMPLE 7 --------------------------

PS > $items = Get-JobSchedulerTaskHistory -Directory /test -Recursive -Succesful -Failed

Returns today's task execution history for any completed tasks from the "/test" directory and any sub-folders recursively.

  • No labels