From 52fa6161789d311ecda073878709e6d05d37d4b7 Mon Sep 17 00:00:00 2001 From: Upgrayedd Date: Wed, 8 Jan 2025 22:23:50 -0600 Subject: [PATCH] Upload files to "/" --- rmm-tartarus-freshpxe-workstation.ps1 | 81 +++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 rmm-tartarus-freshpxe-workstation.ps1 diff --git a/rmm-tartarus-freshpxe-workstation.ps1 b/rmm-tartarus-freshpxe-workstation.ps1 new file mode 100644 index 0000000..14fe145 --- /dev/null +++ b/rmm-tartarus-freshpxe-workstation.ps1 @@ -0,0 +1,81 @@ +# author: https://github.com/bradhawkins85 +$innosetup = 'tacticalagent-v2.8.0-windows-amd64.exe' +$api = '"https://api.upgrayeddsgarage.com"' +$clientid = '1' +$siteid = '3' +$agenttype = '"workstation"' +$power = 0 +$rdp = 0 +$ping = 0 +$auth = '"8be0bc74b9e2a366273392b03b993b054b5633e166a2a376e240f86cbd01fd88"' +$downloadlink = 'https://github.com/amidaware/rmmagent/releases/download/v2.8.0/tacticalagent-v2.8.0-windows-amd64.exe' +$apilink = $downloadlink.split('/') + +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + +$serviceName = 'tacticalrmm' +If (Get-Service $serviceName -ErrorAction SilentlyContinue) { + write-host ('Tactical RMM Is Already Installed') +} Else { + $OutPath = $env:TMP + $output = $innosetup + + $installArgs = @('-m install --api ', "$api", '--client-id', $clientid, '--site-id', $siteid, '--agent-type', "$agenttype", '--auth', "$auth") + + if ($power) { + $installArgs += "--power" + } + + if ($rdp) { + $installArgs += "--rdp" + } + + if ($ping) { + $installArgs += "--ping" + } + + Try + { + $DefenderStatus = Get-MpComputerStatus | select AntivirusEnabled + if ($DefenderStatus -match "True") { + Add-MpPreference -ExclusionPath 'C:\Program Files\TacticalAgent\*' + Add-MpPreference -ExclusionPath 'C:\Program Files\Mesh Agent\*' + Add-MpPreference -ExclusionPath 'C:\ProgramData\TacticalRMM\*' + } + } + Catch { + # pass + } + + $X = 0 + do { + Write-Output "Waiting for network" + Start-Sleep -s 5 + $X += 1 + } until(($connectresult = Test-NetConnection $apilink[2] -Port 443 | ? { $_.TcpTestSucceeded }) -or $X -eq 3) + + if ($connectresult.TcpTestSucceeded -eq $true){ + Try + { + Invoke-WebRequest -Uri $downloadlink -OutFile $OutPath\$output + Start-Process -FilePath $OutPath\$output -ArgumentList ('/VERYSILENT /SUPPRESSMSGBOXES') -Wait + write-host ('Extracting...') + Start-Sleep -s 5 + Start-Process -FilePath "C:\Program Files\TacticalAgent\tacticalrmm.exe" -ArgumentList $installArgs -Wait + exit 0 + } + Catch + { + $ErrorMessage = $_.Exception.Message + $FailedItem = $_.Exception.ItemName + Write-Error -Message "$ErrorMessage $FailedItem" + exit 1 + } + Finally + { + Remove-Item -Path $OutPath\$output + } + } else { + Write-Output "Unable to connect to server" + } +}