How to Run an Automated PowerShell Script
Create automated PowerShell scripts that you can run on multiple computers without user interaction.
Authentication is required only once during the session. If 2FA is set to on demand, the user has to authenticate themselves when they click Create new job or Rerun, otherwise 2FA is done on login.
- On the Manage page under Remote Execution click Create new job.
Result: The Create job page is displayed.
- Add the PowerShell execution step to the list on the left.
- Paste your PowerShell script to the field. You can also select files to upload that the target computers can download.
Note: You can reference the file(s) from the script. You can upload up to three files per job with a maximum size of 1GB each. Any file can be used.
- From the list of Computers define the computers or a group of computers that will receive the script.
- Enter a friendly name that you can easily remember later on.
- Click Run.
Note: A preset timeout pertains to both the job and the task.
The timeout of the job is 24 hours. Practically this means that computers can download the script and report back the result for one day.
Task timeout is set to two hours, that is the target computer waits two hours for the script to start running.
When you reference a file from the script, you only have to enter its name. The path of the file is stored in the central_FilesPath environment variable. Once the task ends, the file is deleted from the target computer, unless it is copied somewhere else with the script.