Skip to main content
All CollectionsRemote Monitoring & ManagementDeploying Agents
How to install the SuperOps agent silently using scripts
How to install the SuperOps agent silently using scripts

Learn how you can install the SuperOps agent silently in the client's endpoints automatically using scripts.

Updated over 3 months ago

If you are looking to mass-deploy the SuperOps.ai agent on all your managed assets, we've got you covered. Use the scripts below to get the job done.

For Windows

1) On Command Prompt (as administrator)

The syntax would look like this:

set msi_installerURL=<URL of the MSI from the site Site> & cmd /v /c for %f in (!msi_installerURL!) do set msi_installer=%~nxf ^& cmd /v /c curl -o !msi_installer! !msi_installerURL! ^& cmd /v /c msiexec /i !msi_installer! /qn LicenseAccepted=YES

For example, if the agent download URL is:

Then the script to install is:

set msi_installerURL=https://superops-wininstaller-prod.s3.us-east-2.amazonaws.com/agent/00000/FZTO7UMH7RI8_1UYGMRUKPITQ8_windows_x64.msi & cmd /v /c for %f in (!msi_installerURL!) do set msi_installer=%~nxf ^& cmd /v /c curl -o !msi_installer! !msi_installerURL! ^& cmd /v /c msiexec /i !msi_installer! /qn LicenseAccepted=YES

2) On PowerShell

The syntax would look like this:

Invoke-Command -ScriptBlock { param ($url) $fileName=Split-Path -Path "$url" -Leaf; [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; invoke-WebRequest -Uri "$url" -Outfile "$fileName"; Start-Process -Wait -FilePath msiexec -ArgumentList /i,$fileName,/qn,LicenseAccepted=YES,/L*V,installation.log ; } -ArgumentList "<MSI Download URL from site>"

For example, if the agent download URL is:

Then the script to install is:

Invoke-Command -ScriptBlock { param ($url) $fileName=Split-Path -Path "$url" -Leaf; [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; invoke-WebRequest -Uri "$url" -Outfile "$fileName"; Start-Process -Wait -FilePath msiexec -ArgumentList /i,$fileName,/qn,LicenseAccepted=YES,/L*V,installation.log ; } -ArgumentList "https://superops-wininstaller-prod.s3.us-east-2.amazonaws.com/agent/00000/FZTOAGFAWEH7RI8_1UYGMRUKPITQ8_windows_x64.msi"

For Mac

The syntax would look something like this:

url="PKG Download URL for Site>"; silentInstall="true"; LOG_NAME="/Users/Shared/superopsInstallation.log"; echo "Starting Installing" > $LOG_NAME; waitForProcess() { processName=$1; fixedDelay=$2; terminate=$3; echo "$(date) | Waiting for [$processName]"; while pgrep -f "$processName" >/dev/null; do [ "$terminate" = "true" ] && { echo "$(date) | Terminating [$processName]..."; pkill -f "$processName"; return; } ; delay=${fixedDelay:-$((RANDOM % 50 + 10))} ; echo "$(date) | Waiting [$delay] seconds" ; sleep $delay ; done ; echo "$(date) | [$processName] ended"; }; checkForRosetta2() { echo "$(date) | Checking for Rosetta 2"; waitForProcess "/usr/sbin/softwareupdate" ; IFS='.' read -r osvers_major osvers_minor <<< "$(/usr/bin/sw_vers -productVersion)" ; [ "$osvers_major" -ge 11 ] && { [ "$(sysctl -n machdep.cpu.brand_string | grep -o "Intel")" ] && echo "$(date) | Intel processor detected" || { pgrep oahd >/dev/null 2>&1 && echo "$(date) | Rosetta installed" || { /usr/sbin/softwareupdate --install-rosetta --agree-to-license && echo "$(date) | Rosetta installed successfully" || { echo "$(date) | Rosetta installation failed" ; exit 1 ; } ; } ; } ; } || echo "$(date) | macOS version $osvers_major.$osvers_minor. No Rosetta needed" ; }; checkForRosetta2; DIRECTORY="/Users/Shared/SuperopsInstaller"; [ ! -d "$DIRECTORY" ] && mkdir -p "$DIRECTORY" && echo "Directory created at: $DIRECTORY"; configFile="/Users/Shared/SuperopsInstaller/soppinstallconfig.properties"; echo "Silent_Install=$silentInstall" > $configFile; echo "Installing" >> $LOG_NAME; export URL=$url; export baseName="$(basename $URL)"; export downLoadFile="/Users/Shared/$baseName"; curl --url "$URL" --output "$downLoadFile" && cd /Users/Shared && sudo -S installer -dumplog -pkg "$baseName" -target /; t=$?; [ -f "$configFile" ] && rm -f "$configFile"; echo "$t is" >> $LOG_NAME; [ $t -ne 0 ] && { echo "Failed to Install $t" >> $LOG_NAME; exit 1; } || echo "Installation success" >> $LOG_NAME; exit 0

For Linux

The syntax would look something like this:
​

export URL="<Download URL>" && export baseName="$(basename $URL)" && wget --secure-protocol=TLSv1_2 $URL -O "/tmp/$baseName" && sudo chmod a+x /tmp/$baseName && sudo /tmp/$baseName --quiet yes --AcceptLicense yes --verbose yes 2>&1 | sudo tee /tmp/superopsInstallation.log


​
​The script should run as a root user.
​

πŸ“ Note: The MSI/PKG URL varies based on the client and the site to which the asset should belong. Make sure to copy the right one from the assets page.


πŸ“ Note: Here are the OS versions that the agent supports:

  • Windows: Windows 8.1 and newer, Windows 2012 R2 and newer

  • .Net: 4.7.2 and newer

  • macOS: 10.15 and above, Rosetta is mandatory


Did this answer your question?