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:
- Navigate to the Endpoints page.
- 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 Policies to configure script execution from the policy list. With a policy, you can create a workflow that ensures remote endpoints run a script according to a preset schedule. For more information, see Automating with Action1 Policies.
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 in the library to reuse later.
Select Execute the script above only if the policy 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 policy 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.
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.
3. On the Frequency step, add a policy title and pick the right time to execute it. For example, you run the policy once – now or at specific time. Or you can schedule a policy 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.
4. After clicking Finish, you’ll be forwarded to the Policies / History page. Here you can see the execution details. If you opted-in to execute the policy later, you’ll find it on the Policies page.