Set Package Schedule
Description
Section titled “Description”Sets the schedule for a package. If the package already has a schedule, it’s updated. Otherwise, a new schedule is created. The schedule is always set to active.
Syntax
Section titled “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
Section titled “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”. If left empty, the start date is set to the current date and time.
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 end date in the format “yyyy-MM-dd HH:mm” eg. “2015-04-17 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”
If left empty, the current recurrence of the schedule isn’t changed.
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 = “” or any other value 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 day of the week, Monday to Sunday
- 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)
Return value
Section titled “Return value”Boolean. The function returns true if it succeeds, otherwise false.
Example
Section titled “Example”This example sets a schedule on the Hardware inventory package on management point 1. The package runs on weekdays from 2015-04-15 12:05 to 2015-04-17 12:05.
Set oCMS = CreateObject("CapaInstaller.SDK")wscript.echo oCMS.SetInstanceManagementPoint("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")