Skip to content

Commit

Permalink
Merge pull request #291 from silversword411/main
Browse files Browse the repository at this point in the history
docs: update PowerShell script for TRMM agent installation with varia…
  • Loading branch information
silversword411 authored Nov 26, 2024
2 parents 50b15cb + d7c4878 commit 0a6147c
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions docs/install_agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,18 @@ If you want to deploy the TRMM agent using AD, Intune, Mesh, TeamViewer, Group P
=== ":material-powershell: powershell"

```powershell
Invoke-WebRequest "<deployment URL>" -OutFile ( New-Item -Path "c:\ProgramData\TacticalRMM\temp\trmminstall.exe" -Force )
$proc = Start-Process c:\ProgramData\TacticalRMM\temp\trmminstall.exe -ArgumentList '-silent' -PassThru
# Update variables
$deploymenturl = "<deployment URL>"
$agentstoinstall = 1 # Replace with the number of agents to install if greater than 20

# Do not modify below here
$randomSleepTime = if ($agentstoinstall -gt 1) { Get-Random -Minimum 1 -Maximum (($agentstoinstall + 1) * 2) } else { 1 }
Start-Sleep -Seconds $randomSleepTime
Invoke-WebRequest $deploymenturl -OutFile (New-Item -Path "c:\ProgramData\TacticalRMM\temp\trmminstall.exe" -Force)
$proc = Start-Process "c:\ProgramData\TacticalRMM\temp\trmminstall.exe" -ArgumentList '-silent' -PassThru
Wait-Process -InputObject $proc

if ($proc.ExitCode -ne 0) {
Write-Warning "$_ exited with status code $($proc.ExitCode)"
Write-Warning "$proc exited with status code $($proc.ExitCode)"
}
Remove-Item -Path "c:\ProgramData\TacticalRMM\temp\trmminstall.exe" -Force
```
Expand Down

0 comments on commit 0a6147c

Please sign in to comment.