×
×
×
×

How to Schedule a Script in Endpoint Central

In certain scenarios, you may need to run scripts on a regular basis to achieve tasks like file cleanup, system maintenance, or other recurring actions. Endpoint Central provides an efficient way to automate these tasks using the File Folder and Scheduler configurations. This guide will walk you through the steps to set up and configure scheduled scripts, ensuring that your tasks are executed periodically and consistently across your devices.

What is Scheduling a Script

Scheduling a script involves automating the execution of a script at a predefined date and time. 

In Endpoint Central, scheduling a script is achieved using a Collection, which consists of two key configurations:

  • File/Folder Configuration: Deploys the script file to a designated location on target machines.
  • Scheduler Configuration: Registers the script in Windows Task Scheduler on target machines, ensuring it executes at the specified time.

How to Configure File Folder and Scheduler Configuration as Collection to Schedule a Script

  1. In the Endpoint Central console, navigate to Configurations > Collection > Computer Collection
  2. Schedule Script File Folder

  3. Add File Folder Configuration
  4. Schedule Script Scheduler

  5. Add Scheduler Configuration
  6. Click Save & Continue
  7. Schedule Script File Folder

  8. In the File Folder configuration:
      1. Select Action as Copy
      2. Select Type as Copy using HTTP
      3. Select Action Type as Files
      4. Upload the script file
      5. Specify the destination location to copy the file
      6. Click Save & Continue

    Schedule Script Scheulder

  9. In the Scheduler configuration:
        1. Select Action as Create Task
        2. Specify Name of the Task
        3. Specify the Application Name
        4. Specify the Arguments
        5. Depending on the script execution platform, use the appropriate application name and arguments:

          For PowerShell scripts:

          Application Name: powershell.exe

          Arguments: -executionpolicy remotesigned -file "C:\EndpointCentral\cleanup_logfiles.ps1"

          For Batch (.bat) scripts:

          Application Name: cmd.exe /c

          Arguments: "C:\EndpointCentral\cleanup_logfiles.bat"

          Note
          Note: As per the scheduler configuration, Endpoint Central will add only the task to the Windows Task Scheduler. The script execution will be managed by the Windows API.

          Schedule Script File Folder

        6. Click Trigger
        7. Specify Frequency
        8. Specify Start At
        9. Click Save & Continue
  10. Define the targets for the deployment.
  11. Specify retry options, if required
  12. Click Save & Continue
  13. Click Deploy

You have successfully Scheduled a Script using Endpoint Central.