Sunday 1 February 2015

Upload Files to Sharepoint Document Library Using Task Scheduler



Steps to configure Task Scheduler with PowerShell scripts:

1. Create a folder containing the files to upload to SharePoint. In my case it is C:\Documents

2. Create another  folder to keep the Script file (i.e. BulkUpload.ps1). The script for uploading documents to share point library is already mentioned in my previous Blog.


 
3. Open Start -> Task Scheduler, see below Screenshot


     
4. Create a New Task.Following Window will appear, Give a Name to the Task and Select Two options mentioned in Screenshot to run as administrator



5. Click Action Tab -> New. A window will appear to set the actions



Enter powershell.exe as Program\script and the path to power shell script (C:\TaskSchedulerScript\BulkUpload.ps1) as arguments. Click OK
 
 
6. Click on Triggers ->New ->Give scheduler Time to run


7. When you click OK to confirm task creation, you will be prompted to enter the password for the account you selected to run the script.

8. Enter the password and click OK

9. You can see a task is created in the Task Scheduler Library (if not, click refresh in the right-hand panel)