Integrate with existing remote access tool (RustDesk)
Written By Mikel from Gorelo
You can integrate Gorelo with any remote access tool that supports launching via a URL E.g RustDesk, Splashtop, AnyDesk, TeamViewer.
โ
In this example, we'll use RustDesk. It is strongly recommended to host your own RustDesk server and modify the initial install script to support this.
Step 1: Create the custom asset fields
Navigate to Settings -> Assets -> Custom Fields
Add custom field with the following details
Name: RustDesk ID
Variable: rustdeskID

Add custom field with the following details
Name: RustDesk Password
Variable: rustdeskPassword

Step 2: Create the installer file
Navigate to Settings -> Asset -> Files
Add a File with the following details:
File: Upload the latest RustDesk MSI installer
Variable: rustdesk
Step 3: Create the scripts
Navigate to Scripts
Create a script with the following details:
Name: Install Rustdesk
Content:
Example#Install Rusdesk
msiexec /i $gorelo:file.rustdesk /qn /norestart CREATESTARTMENUSHORTCUTS="N" CREATEDESKTOPSHORTCUTS="N" /l*v install.logCreate a script with the following details:
Name: Write Rusdesk ID and Password
Content:
Example$RustDeskPath = "$env:ProgramFiles\RustDesk\RustDesk.exe"
# Get Rustdesk ID using the executable
$RustdeskID = cmd /c "`"$RustDeskPath`" --get-id"
if ($RustdeskID) {
# Write ID to Gorelo custom field
GoreloAction -SetCustomField -Name 'asset.rustdeskID' -Value $RustdeskID
Write-Output "Rustdesk ID: $RustdeskID written to Gorelo"
# Generate random 16 character password
$Password = -join ((65..90) + (97..122) + (48..57) | Get-Random -Count 16 | ForEach-Object {[char]$_})
# Set the password in Rustdesk
cmd /c "`"$RustDeskPath`" --password $Password"
# Write password to Gorelo custom field
GoreloAction -SetCustomField -Name 'asset.rustdeskPassword' -Value $Password
Write-Output "Rustdesk password set and saved to Gorelo"
exit 0
} else {
Write-Output "Failed to get Rustdesk ID"
exit 1
}Step 4: Deploy the scripts via a policy
Navigate to Policies
Edit an existing policy that covers the assets you want to install and connect to via RustDesk
Add a continuous Service check for RustDesk Service. Add the โInstall Rustdeskโ script as a remediation step
Add the 'Write Rusdesk ID and Password' script and set to repeat daily at your preferred time
Save and Distribute the policy
Step 5: Create the Shortcut
Navigate to Asset Shortcuts
Add a new Shortcut with the following details:
Name: RustDesk
URL: rustdesk://{{$gorelo:asset.rustdeskID}}?password={{$gorelo:asset.rustdeskPassword}}
Pinned Name: RustDesk

You should now see the the RustDesk shortcut up the top-right corner of the Asset Detail page. If the script successfully populated the custom fields, then this shortcut will launch the RustDesk application.