Wednesday, June 29, 2011

Sharepoint 2010 - Task/Job Scheduler


TASK SCHEDULER-

Ø  Create file to run in Task Scheduler
Ø  Debug Task Scheduler
Ø  Schedule Task scheduler to run at specific time.
Below are points showing this-

Create file to run in Task Scheduler

Step 1: Add new project-> class library
Step2: Choose output type as console application and Target Framework as .Net framework 3.5.
Step3: Rename Class.cs as Program.cs..
Step4: add reference as Sharepoint.dll and add using Microsoft. SharePoint in file
Step 5: All methods and variables should be static

How to Debug Task Scheduler

Just select project as “Set as start project”, we can directly run project by clicking Debug.

Set Task scheduler/Job scheduler

Go to -> C:\Documents and Settings\All Users\Start Menu\Programs\Accessories\System Tools\Scheduled Tasks
Or
Go to -> Administrative Tools/Task scheduler
>Right click on Task scheduler library and click Create Task, below window will appear.
>Add name and choose “Run whether user is logged on or not” and then select Triggers tab
         


>Select date to schedule job and select Actions tab     


>Click browse and in project application go to bin->debug->choose (filename).exe file as shown below.

>Click ok it will ask for username and password, enter that and select ok. 

  

 

                

1 comment: