Set Package Schedule

Description

Sets the schedule for a package


Syntax

SetPackageSchedule(ByVal packageName As String, ByVal packageVersion As String, ByVal packageType As String, ByVal scheduleStart As String, ByVal scheduleEnd As String, ByVal scheduleIntervalBegin As String, ByVal scheduleIntervalEnd As String, ByVal scheduleRecurrence As String, Optional ByVal scheduleRecurrencePattern As String = "") As Boolean


Parameters

PackageName (String)

The name of the package

PackageVersion (String)

Package version

PackageType (String)

Type of package

  • "Computer"
  • "User"

ScheduleStart (String)

The Schedule start date in the format  "yyyy-MM-dd HH:mm" eg. "2015-04-15 12:05"

yyyy - Year with century.
MM - Numeric month with a leading zero.
dd - Numeric day of the month with a leading zero.
HH - 24 Hour clock with leading zero.
mm - Minutes with leading zero.

ScheduleEnd(String)

The Schedule start date in the format  "yyyy-MM-dd HH:mm" eg. "2015-04-15 12:05". If no end date is wanted leave the string empty. e.g. ""

yyyy - Year with century.
MM - Numeric month with a leading zero.
dd - Numeric day of the month with a leading zero.
HH - 24 Hour clock with leading zero.
mm - Minutes with leading zero.

ScheduleIntervalBegin (String)

The Schedule Interval begins time in the format  HH:mm" eg. "06:00". If left empty it is set to 00:00

HH - 24 Hour clock with leading zero.
mm - Minutes with leading zero.

ScheduleIntervalEnd (String)

The Schedule Interval end time in the format  HH:mm" eg. "12:00". If left empty it is set to 00:00

HH - 24 Hour clock with leading zero.
mm - Minutes with leading zero.


ScheduleRecurrence(String)

The Schedule Recurrence for the schedule.

Possible values:

  • "Once"
  • "PeriodicalDaily", use the variable ScheduleRecurrencePattern detail this recurrence
  • "PeriodicalWeekly", use the variable ScheduleRecurrencePattern detail this recurrence
  • "Always"


ScheduleRecurrencePattern (String)

Is used to further detail the Schedule Recurrence when set to PeriodicalDaily or PeriodicalWeekly

Possible values:

  • ScheduleRecurrence = "PeriodicalDaily"
    • ScheduleRecurrencePattern  = "RecurEveryWeekDay" sets the recurrence pattern to run every weekday
    • ScheduleRecurrencePattern  = "" Sets the recurrence pattern to recur every day including weekend days.
  • ScheduleRecurrence = "PeriodicalWeekly"
    • ScheduleRecurrencePattern   = "1,3,5" Will set the schedule pattern to run Monday, Wednesday and Friday. All weekdays can be combined with a comma (,) (1,2,3,4,5,6,7)
      • Monday = 1
      • Tuesday = 2
      • Wednesday = 3
      • Thursday = 4
      • Friday = 5
      • Saturday = 6
      • Sunday = 7
    • ScheduleRecurrencePattern   = "" Will set the schedule recurrence pattern to run every weekday 



Return value

Boolean. The function returns true if it succeeds, otherwise false.


Example 1

This example moves the Hardware inventory package,  to a folder 'NewFolder2', on management point 1

VBScript
Set oCMS = CreateObject("CapaInstaller.SDK") 
wscript.echo oCMS.SetDefaultManagementPoint("1") 
Wscript.echo oCMS.SetPackageSchedule("HWInventory", "v4.1", "Computer", "2015-04-15 12:05", "2015-04-17 12:05", "00:00", "00:00", "PeriodicalDaily", "RecurEveryWeekDay")