This Wednesday | 12 PM EDT / 4 PM CEST

Action1 5 Documentation 5 Run Scripts on Remote Computers

Run Scripts Remotely

 With Action1, you can assist your colleagues remotely and run Powershell or CMD scripts on multiple remote computers. Read this article to learn how to execute scripts on remote machines with the help of Action1 tools.

To run PowerShell or CMD script on a remote computer:

  1. Navigate to the Endpoints page.
  2. Locate one or several endpoints where you want to execute a script and select the Actions icon next to the endpoint name and specify Run Script. Or simply select the Run Script button on top of the endpoints list.

Aletrnatively, navigate to Automations to configure script execution. With an automation, you can create a workflow that ensures remote endpoints run a script according to a preset schedule. For more information, see Automation with Action1.

Endpoints view and General tab expanded

To complete the wizard:

1. On the Run Script step, enter the command or upload a script from the Script Library that contains dozens of administration and configuration scripts. The scripts from the library can include parameters for fine-tuning and customizing these scripts, for example, the offset value you can specify for this action, a message to be displayed to device owners. If adding a new script, consider saving it in the library to reuse later.

Select Execute the script above only if the automation condition script returns a non-zero error code to verify the endpoint compliance state before executing the main script. Provide a condition script (CMD or PowerShell) to test your endpoints and specify the exit codes. Action1 will run this script first and if the condition script exits with something diffirent than the 0 exit code, then Action1 will run the main script. The main script is meant to bring the endpoint into compliance. For example, check the number of days since the last endpoint reboot and force reboot is the number of days is more than 90. 

Run script automation - step 1

2. On the Select Endpoints step, check the list of endpoints. Select Add Endpoints to include more endpoints. Action1 enables you to pick endpoints individually, or you can specify an entire endpoint group.

Run script automation - step 2

3. On the Schedule step, add a title and pick the right time to execute the automation. For example, you can run the automation once – now or at specific time. Or you can schedule an automation to run every day, every week, every month, etc.  By default, Action1 will attempt to distribute this script to the powered-off endpoints if they get back online within 24 hours time frame. Update this setting if necassary but make sure not to set the missing schedule time frame setting to an interval longer than the frequency of action execution (i.e., don’t set it to 48 hours if the action is executed every day). Once ready, click Finish.

Run script automation - step 3

4. After clicking Finish, you’ll be forwarded to the Automation / History page. Here you can see the execution details. If you opted-in to execute the automation later, you’ll find it on the Automations page.

Run script automation - History