Team: Huntress Managed Endpoint Detection and Response
Product: Command installation
Environment: Windows
Summary: Using a single command via Command Prompt (CMD) or PowerShell (PoSh) to install the Huntress Agent
While we highly recommend using one of these deployment scripts to install the Huntress agent, we do realize there are use cases for a single command install.
Please be aware that these commands provide no error checking, installation validation, etc. PowerShell and Command Prompt errors can be difficult to understand. If you are not familiar with troubleshooting PoSh/CMD errors please use one of the other installation methods.
Before running any of the following commands, replace the instances of YOUR_ACCOUNT_KEY with your Huntress account key and YOUR_CLIENT_NAME with the customer name, do not remove the quotes or modify anything else in the commands. All commands must be run from an admin-level PoSh/CMD window.
PowerShell Preferred method
This command downloads our PowerShell script and executes it. This is preferred since the PowerShell script will log the deploy actions to HuntressPoShInstaller.log inside %program files%\Huntress\ which will make troubleshooting significantly easier.
$AccountKey = "YOUR_ACCOUNT_KEY"; $OrgKey = "YOUR_CLIENT_NAME"; (New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/huntresslabs/deployment-scripts/main/Powershell/InstallHuntress.powershellv2.ps1',$env:temp+'/InstallHuntress.powershellv2.ps1'); iex "powershell -executionpolicy bypass -command ''$env:temp\InstallHuntress.powershellv2.ps1 -a $AccountKey -o $OrgKey''"
CMD Preferred method
Similar to above, this command launched from Command Prompt will download the Huntress PoSh deploy script and then execute it (PowerShell 3+ must be runnable on the machine).
SET AccountKey=YOUR_ACCOUNT_KEY && SET OrgKey=YOUR_CLIENT_NAME && powershell -executionpolicy bypass -command "(New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/huntresslabs/deployment-scripts/main/Powershell/InstallHuntress.powershellv2.ps1','%temp%\InstallHuntress.powershellv2.ps1'); iex '%temp%\InstallHuntress.powershellv2.ps1 -a " %AccountKey% " -o " %OrgKey% "'"
If any of the commands fail, check for any surplus spaces within or trailing the line. Also verify there are no assets in \Program Files\Huntress\, no Huntress assets in $env:temp, and that no Huntress services are running. You may need to reboot first if the machine previously had Huntress installed.
Unsupported Commands
The following run the Huntress installer executable directly, because of that there will be no installer logs which could make troubleshooting considerably more difficult. These should only be used when the instructions above don't work for your environment and there are no specific scripts for your deploy automation system. Huntress is unable to provide support for the below methods.
From a PowerShell Prompt (powershell.exe, must be run as admin):
$AccountKey = "YOUR_ACCOUNT_KEY"; $OrgKey = "YOUR_CLIENT_NAME"; (New-Object Net.WebClient).DownloadFile("https://huntress.io/download/$AccountKey/HuntressInstaller.exe",$env:temp+"/HuntressInstaller.exe"); iex -command "$env:temp\HuntressInstaller.exe /ACCT_KEY=$AccountKey /ORG_KEY='$OrgKey' /S"
From a Command Prompt (cmd.exe, must be run as admin):
SET "AccountKey=YOUR_ACCOUNT_KEY" && SET "OrgKey=YOUR_CLIENT_NAME" && powershell -executionpolicy bypass -command "(New-Object Net.WebClient).DownloadFile('https://update.huntress.io/download/%AccountKey%/HuntressInstaller.exe','%temp%\HuntressInstaller.exe'); iex '%temp%\HuntressInstaller.exe /ACCT_KEY=%AccountKey% /ORG_KEY=%OrgKey% /S'"