Skip to main content

Huntress - Command

Summary​

This script takes an action parameter of 'Install', 'Uninstall', or 'ReInstall' and performs that action on the target machine.

Sample Run​

Sample Run

Variables​

Document the various variables in the script. Delete any section that is not relevant to your script.

NameDescription
InstalledThis is 0 (Uninstalled) or 1 (Installed).
UninstallStateThis is 0 (Success) or 1 (Failed).
InstallStateThis is 0 (Success) or 1 (Failed).

Global Parameters​

NameExampleRequiredDescription
Acct_Keyhfdkjaldhfuinb933487fg0aTrueThis is the assigned Account Key for Huntress.

User Parameters​

NameExampleRequiredDescription
Action'Install', 'Uninstall', or 'ReInstall' - Default = InstallFalseThe action you wish to take with the Huntress application.

Process​

  1. Action - Uninstall or Reinstall
    1. Start Uninstall.
    2. Check for method of removal and remove.
    3. Check if still installed.
    4. Return 0 if successfully removed; return 1 if still present - Variable UninstallStatus, Logged.
    5. If return is 0 and there is a 'ReInstall' action, then initiate install; otherwise, exit with an error.
  2. Action Install - or sent to by Reinstall action
    1. Check if account key applies; set InstallState to 1 if not valid and return an error.
    2. Download the application for Mac or Windows.
    3. Execute the installer for Mac or Windows.
    4. Check for the installation.
    5. Return 0 if the software is installed or 1 if Huntress is not installed.
    6. Errors out if failed.

Output​

  • Script log

Changelog​

2025-04-10​

  • Initial version of the document