Skip to content

Instantly share code, notes, and snippets.

@Iristyle
Last active Mar 20, 2018
Embed
What would you like to do?
Scheduled Task Trigger Types

Puppet Hash Definition

  • required parameter
  • example value
Type Format Example v1
TASK_TRIGGER
v2
ITrigger
schedule string enum daily
weekly
monthly
once
TriggerType Type
start_time time string HH:MM 13:21 wStartHour
wStartMinute
StartBoundary
start_date Date string YYYY-MM-DD 2011-08-31 wBeginYear
wBeginMonth
wBeginDay
StartBoundary
minutes_interval numeric 30 MinutesInterval Repetition.Interval
minutes_duration numeric 480 MinutesDuration Repetition.Duration

Trigger Specific Hash Additions

Trigger Specific Type Format v1 map v2 map
every numeric 1 - daily
2 - every other 
etc

1 - weekly
2 - every other
etc
daily - DaysInterval
weekly - WeeksInterval
IDailyTrigger
    DaysInterval
IWeeklyTrigger
    WeeksInterval
day_of_week string enum mon
tues
wed
thurs
fri
sat
sun
all

[mon, tues]
weekly - rgfDaysOfTheWeek
monthly (weekday) - rgfDaysOfTheWeek
IWeeklyTrigger
    DaysOfWeek
IMonthlyDOWTrigger
    DaysOfWeek
months numeric enum Jan = 1
Feb = 2
Mar = 3
Apr = 4
May = 5
Jun = 6
Jul = 7
Aug = 8
Sep = 9
Oct = 10
Nov = 11
Dec = 12

[1, 3, 5]
monthly (date) - rgfMonths
monthly (weekday) - rgfMonths
IMonthlyTrigger
    MonthsOfYear
IMonthlyDOWTrigger
    MonthsOfYear
on array of numeric 1-31 for day

[1, 5, 10]
monthly (date) - rgfDays IMonthlyTrigger
    DaysOfMonth
which_occurrence string enum first
second
third
fourth
last
monthly (weekday) - wWhichWeek IMonthlyDOWTrigger
    WeeksOfMonth

ITrigger

Type Format
Enabled boolean
EndBoundary DateTime string YYYY-MM-DDTHH:MM:SS(+-)HH:MM

2005-10-11T13:21:17-08:00
2005-10-11T13:21:17Z
ExecutionTimeLimit Duration string PnYnMnDTnHnMnS / P1M4DT2H5M
Id string
Repetition IRepetitionPattern
  Duration - Duration String
  Interval - Duration String
  StopAtDurationEnd - boolean
PnYnMnDTnHnMnS / P1M4DT2H5M
P<days>DT<hours>H<minutes>M<seconds>S / PT20M
StartBoundary DateTime string YYYY-MM-DDTHH:MM:SS(+-)HH:MM

2005-10-11T13:21:17-08:00
2005-10-11T13:21:17Z
Type (read-only) enum TASK_TRIGGER_TYPE2

TASK_TRIGGER_EVENT - 0
TASK_TRIGGER_TIME - 1
TASK_TRIGGER_DAILY - 2
TASK_TRIGGER_WEEKLY - 3
TASK_TRIGGER_MONTHLY - 4
TASK_TRIGGER_MONTHLYDOW - 5
TASK_TRIGGER_IDLE - 6
TASK_TRIGGER_REGISTRATION - 7
TASK_TRIGGER_BOOT - 8
TASK_TRIGGER_LOGON - 9
TASK_TRIGGER_SESSION_STATE_CHANGE - 11

Trigger Specific Properties

Type Format
RandomDelay Duration string P<days>DT<hours>H<mins>M<secs>S

P2DT5S
IDailyTrigger
IMonthlyTrigger
IMonthlyDOWTrigger
ITimeTrigger
IWeeklyTrigger
Delay Duration string PnYnMnDTnHnMnS

P1M4DT2H5M
IBootTrigger
IEventTrigger
ILogonTrigger
IRegistrationTrigger
ISessionStateChangeTrigger
DaysInterval short 1 - daily
2 - every other day
IDailyTrigger
DaysOfWeek short bitwise mask Sun = 0x01
Mon = 0x02
Tue = 0x04
Wed = 0x08
Thur = 0x10
Fri = 0x20
Sat = 0x40
IWeeklyTrigger
IMonthlyDOWTrigger
WeeksInterval short 1 - weekly
2 - every other week
IWeeklyTrigger
WeeksOfMonth short bitwise mask First = 0x01
Second = 0x02
Third = 0x04
Fourth = 0x08
Last = 0x10
IMonthlyDOWTrigger
RunOnLastWeekOfMonth boolean IMonthlyDOWTrigger
MonthsOfYear short bitwise mask Jan = 0x001
Feb = 0x002
Mar = 0x004
Apr = 0x008
May = 0x010
June = 0x020
July = 0x040
Aug = 0x080
Sep = 0x100
Oct = 0x200
Nov = 0x400
Dec = 0x800
IMonthlyDOWTrigger
IMonthlyTrigger
DaysOfMonth long bitwise mask 1 = 0x01
2 = 0x02
3 = 0x04
4 = 0x08
5 = 0x10
6 = 0x20
7 = 0x40
...
31 = 0x40000000
Last = 0x80000000
IMonthlyTrigger
RunOnLastDayOfMonth boolean IMonthlyTrigger
UserId string * User name or SID string
* Group name or SID string
* NULL

"MyDomain\MyName"
for a local account, "Administrator"
ILogonTrigger
ISessionStateChangeTrigger
StateChange enum TASK_SESSION_STATE_CHANGE_TYPE

TASK_CONSOLE_CONNECT = 1
TASK_CONSOLE_DISCONNECT = 2
TASK_REMOTE_CONNECT = 3
TASK_REMOTE_DISCONNECT = 4
TASK_SESSION_LOCK = 7
TASK_SESSION_UNLOCK = 8
ISessionStateChangeTrigger
Subscription XPath query string "<QueryList>
  <Query Id='1'>
    <Select Path='System'>
      *[System/Level=2]
    </Select>
  </Query>
</QueryList>"
IEventTrigger
ValueQueries ITaskNamedValueCollection
of ITaskNamedValuePair
  Name - String
  Value - String
Examples:

name: user
value: Event/UserData/SubjectUserName

name: machine
value: Event/UserData/MachineName
IEventTrigger
@Iristyle

This comment has been minimized.

Copy link
Owner Author

@Iristyle Iristyle commented Mar 19, 2018

TODO: add info about Flags

@Iristyle

This comment has been minimized.

Copy link
Owner Author

@Iristyle Iristyle commented Mar 20, 2018

Default values when creating new Trigger definitions

$triggerEvent
Type               : 0
Id                 :
Repetition         : System.__ComObject
  Interval          :
  Duration          :
  StopAtDurationEnd : False
ExecutionTimeLimit :
StartBoundary      :
EndBoundary        :
Enabled            : True
Subscription       :
Delay              :
ValueQueries       : System.__ComObject
  EMPTY collection / Count: 0

$triggerTime
Type               : 1
Id                 :
Repetition         : System.__ComObject
  Interval          :
  Duration          :
  StopAtDurationEnd : False
ExecutionTimeLimit :
StartBoundary      :
EndBoundary        :
Enabled            : True
RandomDelay        :

$triggerDaily
Type               : 2
Id                 :
Repetition         : System.__ComObject
  Interval          :
  Duration          :
  StopAtDurationEnd : False
ExecutionTimeLimit :
StartBoundary      :
EndBoundary        :
Enabled            : True
DaysInterval       : 1
RandomDelay        :

$triggerWeekly
Type               : 3
Id                 :
Repetition         : System.__ComObject
  Interval          :
  Duration          :
  StopAtDurationEnd : False
ExecutionTimeLimit :
StartBoundary      :
EndBoundary        :
Enabled            : True
DaysOfWeek         : 0
WeeksInterval      : 1
RandomDelay        :

$triggerMonthly
Type                : 4
Id                  :
Repetition          : System.__ComObject
  Interval          :
  Duration          :
  StopAtDurationEnd : False
ExecutionTimeLimit  :
StartBoundary       :
EndBoundary         :
Enabled             : True
DaysOfMonth         : 0
MonthsOfYear        : 4095
RunOnLastDayOfMonth : False
RandomDelay         :

$triggerMonthlyDOW
Type                 : 5
Id                   :
Repetition           : System.__ComObject
  Interval          :
  Duration          :
  StopAtDurationEnd : False
ExecutionTimeLimit   :
StartBoundary        :
EndBoundary          :
Enabled              : True
DaysOfWeek           : 1
WeeksOfMonth         : 1
MonthsOfYear         : 1
RunOnLastWeekOfMonth : False
RandomDelay          :

$triggerIdle
Type               : 6
Id                 :
Repetition         : System.__ComObject
  Interval          :
  Duration          :
  StopAtDurationEnd : False
ExecutionTimeLimit :
StartBoundary      :
EndBoundary        :
Enabled            : True


$triggerRegistration
Type               : 7
Id                 :
Repetition         : System.__ComObject
  Interval          :
  Duration          :
  StopAtDurationEnd : False
ExecutionTimeLimit :
StartBoundary      :
EndBoundary        :
Enabled            : True
Delay              :

$triggerBoot
Type               : 8
Id                 :
Repetition         : System.__ComObject
  Interval          :
  Duration          :
  StopAtDurationEnd : False
ExecutionTimeLimit :
StartBoundary      :
EndBoundary        :
Enabled            : True
Delay              :

$triggerIdle
Type               : 9
Id                 :
Repetition         : System.__ComObject
  Interval          :
  Duration          :
  StopAtDurationEnd : False
ExecutionTimeLimit :
StartBoundary      :
EndBoundary        :
Enabled            : True
Delay              :
UserId             :

$triggerSessionStateChange
Type               : 11
Id                 :
Repetition         : System.__ComObject
  Interval          :
  Duration          :
  StopAtDurationEnd : False
ExecutionTimeLimit :
StartBoundary      :
EndBoundary        :
Enabled            : True
Delay              :
UserId             :
StateChange        : 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment