SPJobDefinition.Execute Method

Executes the job definition on the local machine and is intended to be used only by the timer service.

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No


Public Overridable Sub Execute ( _
    targetInstanceId As Guid _
Dim instance As SPJobDefinition
Dim targetInstanceId As Guid

public virtual void Execute(
    Guid targetInstanceId


  • targetInstanceId
    Type: System.Guid

    For target types of SPContentDatabase this is the database ID of the content database being processed by the running job.

    This value is Guid.Empty for all other target types.


This method is called by the timer service to execute a job, but is not intended as a way to start a job. The new RunNow() method or the Start-SPTimerJob cmdlet should be used instead.

See Also


SPJobDefinition Class

SPJobDefinition Members

Microsoft.SharePoint.Administration Namespace