SPJobDefinition.Schedule property

Gets or sets the schedule of the job definition.

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

'Declaration
Public Property Schedule As SPSchedule
	Get
	Set
'Usage
Dim instance As SPJobDefinition
Dim value As SPSchedule

value = instance.Schedule

instance.Schedule = value

Property value

Type: Microsoft.SharePoint.SPSchedule
An SPSchedule object.

ExceptionCondition
ArgumentNullException

The value that you attempted to set is a null reference (Nothing in Visual Basic).

ArgumentOutOfRangeException

The DateTime structure in the Time property of an SPOneTimeSchedule object specifies a year prior to 1900.

SPException

You are attempting to convert a one-time job to a recurring job, or a recurring job to a one-time job.

If you want the job to run immediately, call the RunNow() method.

Show: