RPort
Searchโ€ฆ
Executing scripts
Learn how to execute scripts directly from the browser or via the API

Preface

You can execute scripts on a per-client basis directly on the clients page. By selecting "scripts" on top navigation, you can execute scripts on many clients in parallel.
Two options for script execution

On Windows

Learn, from this video, how to execute PowerShell scripts on Windows machines (servers or desktop) โ€“ on a single machine and on multiple targets in parallel.
Execute PowerShell scripts with RPort
The video show how to install 7zip and notepad++ fully unattended with RPport using the following lines of PowerShell.
install-7zip.ps1
1
iwr https://7-zip.org/a/7z1900-x64.msi -OutFile 7z1900-x64.msi
2
msiexec /i 7z1900-x64.msi /quiet /qn /norestart
3
sleep 10
4
Remove-Item -Path 7z1900-x64.msi -Force
5
if (Test-Path "C:\Program Files\7-Zip\7z.exe") {
6
Write-Host "7zip installed"
7
}
Copied!
install-notepad++.ps1
1
if (Test-Path "C:\Program Files\Notepad++\notepad++.exe" -PathType leaf) {
2
Write-Host "Notepad++ is already installed."
3
}
4
else {
5
cd $env:Temp
6
iwr https://notepad-plus-plus.org/repository/7.x/7.0/npp.7.Installer.x64.exe -OutFile npp.7.Installer.x64.exe
7
.\npp.7.Installer.x64.exe /S
8
sleep 10
9
rm npp.7.Installer.x64.exe -Force
10
New-Item -ItemType SymbolicLink -Path "C:\Users\Public\Desktop\" -Name "notepad++.lnk" -Value "C:\Program Files\Notepad++\notepad++.exe"
11
Write-Host "Notepad++ installed"
12
}
Copied!

On Linux

Type in the content of a script. You can use a regular shebang as first line like #!/bin/bash or #!/usr/bin/env python3.
Executing Python
If no shebang is given, /bin/sh is used to execute your script.
Last modified 19h ago
Export as PDF
Copy link