locked
Run Sharepoint file using Task scheduler RRS feed

  • Question

  • Hi

    I have created a powershell script file and uploaded in sharepoint document library.

    I want to run that script using task scheduler.But in task scheduler we can give only local path right?

    Is there any possibilities to refer a script file which is in sharepoint site?

    Please reply

    Thanks

    Poovi

    Wednesday, October 11, 2017 10:58 AM

Answers

  • Hi Poovi,

    instead of that why dont you create SharePoint Timer Job which will do the job for you


    Abhijeet S. Thorat



    If my post solves your problem could you mark the post as Answered or Vote As Helpful if my post has been helpful for you.

    • Marked as answer by Poovi Wednesday, October 11, 2017 12:05 PM
    Wednesday, October 11, 2017 11:05 AM
  • Hi Poovi,

    As per my knowledge there is no option to refer a script file which is in SharePoint site in the windows task scheduler. You have to keep the file in local drive.

    If you don't want to keep the file in local drive and want to keep it in SharePoint Site then as Abhijeet told it is better to create a timerjob in SharePoint which will call the script and execute.

    Regards, 


    SAGAR PATIL

    • Marked as answer by Poovi Wednesday, October 11, 2017 12:05 PM
    Wednesday, October 11, 2017 11:22 AM

All replies

  • Hi Poovi,

    instead of that why dont you create SharePoint Timer Job which will do the job for you


    Abhijeet S. Thorat



    If my post solves your problem could you mark the post as Answered or Vote As Helpful if my post has been helpful for you.

    • Marked as answer by Poovi Wednesday, October 11, 2017 12:05 PM
    Wednesday, October 11, 2017 11:05 AM
  • Hi Poovi,

    As per my knowledge there is no option to refer a script file which is in SharePoint site in the windows task scheduler. You have to keep the file in local drive.

    If you don't want to keep the file in local drive and want to keep it in SharePoint Site then as Abhijeet told it is better to create a timerjob in SharePoint which will call the script and execute.

    Regards, 


    SAGAR PATIL

    • Marked as answer by Poovi Wednesday, October 11, 2017 12:05 PM
    Wednesday, October 11, 2017 11:22 AM
  • Thanks for the reply.

    I will try to do that.

    what all files can be executed using windows task scheduler?

    Only powershell or any other files like exe,workflow etc..?

    Please clarify.

    Poovi

    Wednesday, October 11, 2017 12:06 PM
  • Hi,

    • You cannot directly run a SharePoint Hosted Script file from Task Scheduler. You can only invoke a local script file. 

    Having said that, you have one option : Within the local script file that you invoke using task scheduler, write the PS code to download your SharePoint Hosted Script file . Once its downloaded, invoke the downloaded script file from the local script file that you are running now from task scheduler

    Download SP file using PS

    Invoke another PS1 from Current PS1

    • If you feel the above approach is an overkill, use SharePoint Timer Jobs :

        Step By Step SP Timer Guide

    Regards,

    Priyan


    Please Up Vote and Mark this as Answer if it helps.

    Wednesday, October 11, 2017 12:09 PM