Remote PowerShell Script Execution
With enabled RMM Service management mode and 2FA, you can run PowerShell scripts remotely from Management Console on computers with RMM Agent installed.
As of Management Console 5.6 and RMM Agent 1.2, the following script execution features are supported:
- Exit codes
- Script errors displayed
- Copy and paste
- Script interruption
RMM Agent Powershell execution has some limitations:
- PowerShell version 5.0 or later is recommended. PowerShell version 4.5 can be used, but with restrictions:
- Once a command or script are executed, results of the previous command/script are not available
- Interactive PowerShell scripts are not supported
- Two-factor authentication must be enabled in your account
Run PowerShell Scripts on Remote Computer
To use a PowerShell console or to upload a PowerShell script to execute on a remote computer, proceed as follows:
- Open the Management Console.
- On Computers select Remote Management if you use legacy main menu, or open RMM > Computers page in the new main menu.
- In the computer list, find the target computer, then in the RMM column click the diagram icon.
As the computer info is loaded, switch to the PowerShell tab.
Enter the 2FA code.
Enter the command or click + to upload the PowerShell script to the remote computer.
Once the script is uploaded, click Execute.
Run PowerShell Scripts on Multiple Computers
You can run PowerShell scripts remotely on multiple computers with the RMM Agent installed.
To run PowerShell scripts on multiple computers from a file, proceed as follows:
- Open the Management Console.
- In the Computers menu, select Remote Management.
- Click Group Actions and select RMM Group Actions. RMM Group Action wizard starts.
- On the Select step, select computers to run the PowerShell script on. Click Next.
- Specify the 2FA code.
- Select the Execute PowerShell from file or PowerShell Terminal.
- Click + to upload the PowerShell script or type the command in the console.
The uploaded script appears in the script area:
- Once the PowerShell script is uploaded, click Execute.
- Monitor the progress on the Result step.
- Check the script execution results.
In case the script cannot be executed on some computer, you will be notified with a failure reason:
- Click the Download result link to download the CSV file with the script execution results.
Note that PowerShell scripts are run by the 'System' account