Skip to main content
Connect your AI

Installing the endpoint agent

You install the endpoint agent on your staff's Windows computers with your RMM, Intune or another endpoint product. The package is a signed Windows installer (an MSI). There are two ways to install…

Written By Christopher Scaminaci

Last updated 4 days ago

You install the endpoint agent on your staff's Windows computers with your RMM, Intune or another endpoint product. The package is a signed Windows installer (an MSI). There are two ways to install it, and you pick ONE: deploy the MSI yourself with its settings, or run the install script, which downloads the same MSI, checks it, and installs it. This page walks through the setup, the removal, and what the package puts on a computer. What the agent does is in The StackJack endpoint agent.

At a glance

  • What it does: shows how to install the agent on Windows computers with your RMM.
  • Plan: every plan.
  • Who: an Administrator.
  • Where: AI Governance → Staff computers → Deploy, on the Endpoint agent card. The Devices tab of the Endpoint agent page and Staff computers → Coverage show what enrolled.

Before you start

  • You need the Admin role in AI Governance.
  • The agent must be available in your region and have a released version. Step 1 of the Deploy page says so if it is not: "The endpoint agent is not available in this region yet." or "The endpoint agent has no released version yet." With no released version there is no package to install yet.
  • Each computer needs 64-bit Windows, on Intel or AMD or on ARM. The page offers one package for each.
  • The page shows the product name and the version of the package in the third check of step 1 and on the card Your package. If it says "Your branded package is not built for this version yet", wait for the next agent release.

The Deploy page

The menu entry Deploy opens the page Deploy to staff computers. Open Coverage, in the page head, opens the page that lists each computer.

At the top are two cards, one for each product: Browser extension and Endpoint agent. Select the Endpoint agent card. Each card shows one state and how far the product reaches:

State on the cardWhat it means
Not availableThe agent is not available in your region yet, or it has no released version yet.
Turned offThe agent is off for this organization.
Needs a keyThe agent is on, and the organization has no enrollment key yet.
Not readyThere is no package to install yet. Step 1 says why.
Waiting for dataEverything is ready, and no computer has enrolled yet.
Needs attentionComputers are enrolled, and none of them was seen in the last 24 hours.
WorkingAt least one enrolled computer was seen in the last 24 hours.

The card also says how many of the enrolled computers report, for example "38 of 52 computers report", with a bar. Before a computer enrolls, it reads "No computer reports yet".

Under the cards is one panel, Deploy the endpoint agent, with three numbered steps:

  1. Check that it is ready
  2. Choose how you deploy, then do it
  3. Watch computers report

Beside the steps are three cards with the facts: Reach, Your enrollment key and Your package.

The page has at most one filled button: the next thing to do. That is I have saved it while a key is on screen, else Turn it on, else Make an enrollment key. Once the three checks pass, no button is filled.

Set it up

  1. Open AI Governance → Staff computers → Deploy and select the Endpoint agent card. If you manage client organizations, pick the Organization in the head of the panel first. The switch, the key, the package and the computers belong to the organization you pick.
  2. In step 1, Check that it is ready, read the three checks:
    • Turned on or Turned off. If the check says Turned off, press Turn it on.
    • Enrollment key ready or No enrollment key yet. If the check says No enrollment key yet, press Make an enrollment key. The page shows the key one time, with a Copy key button. While it is on screen, every command on the page already carries it. After you press I have saved it, the commands show the placeholder <your enrollment key> again.
    • Package ready or No package yet. A ready package shows its product name and version.
  3. If you saved a key earlier, open Already saved a key? Paste it to fill it into the commands. and paste it. It fills the commands, it stays on the page and it is never saved.
  4. In step 2, Choose how you deploy, then do it, pick one card: Microsoft Intune (marked Recommended), Group Policy or Script. The numbered lines under the cards are the ones for the card you picked, and each line holds the download, the command or the Copy button it needs. Each way is described below. Until step 1 has a package ready, step 2 reads "Opens when step 1 has a package ready."
  5. Choose your policy on the Endpoint agent page. See Endpoint agent policy. AI app control and AI site control start at Allow, which only reports. The paste check starts on. No local AI tool is watched until you choose. Decide what should happen before you install widely.
  6. If you want a lock on removal, set an uninstall code now. See Endpoint agent policy.
  7. Run the install on one computer first. In step 3, Watch computers report, the page says how many of the enrolled computers report. They are counted over the last 24 hours, and a computer shows there a few minutes after the agent installs and enrolls. See which computers opens Staff computers → Coverage, and Open the agent's Devices tab opens the Devices tab of the Endpoint agent page. Wait for the computer to appear. It shows its computer name, its Windows version, its agent version and when it was last seen. On Coverage, the Endpoint agent column says Reporting while the agent is healthy and has checked in within 24 hours. You can sort the Devices table, search it, filter it by health, platform and agent version, and open a row to see the last report the agent sent.

To get a key again, press Make a new key on the card Your enrollment key. A dialog opens: type ROTATE and press Make a new key. The new key is shown once, in step 1. The key you have keeps working for 7 days, so installs in progress can finish.

The Enrollment keys tab of the Endpoint agent page lists your keys, with their prefix and state, and is where you rotate or revoke one.

Microsoft Intune

You upload the MSI as an app. The card is marked Recommended. Its lines are:

  1. Download the installer for your computers. Each platform has a row: Windows, 64-bit Intel or AMD (most computers) and Windows, 64-bit ARM (Surface and other ARM computers). Press Download the MSI. Show the checksum opens the SHA-256 of that file.
  2. Open the Intune admin center. Go to Apps, All apps, Create, then Windows and Line-of-business app. Upload the MSI.
  3. Paste this into Command-line arguments. The page shows the one argument, with a Copy button: ENROLLMENTKEY="<your enrollment key>". Intune adds the silent flag itself. While the argument shows the placeholder, the page says "Make a key in step 1, or paste one, and it is filled in here."
  4. Assign the app as Required to your group of computers, then create it.

Intune takes one command-line argument for an MSI, and the key is that one. Make a separate app for Windows ARM computers. Adding a newer MSI later upgrades the agent and needs no uninstall code.

Group Policy

Group Policy cannot hand an enrollment key to an MSI it installs (that needs a transform file). So this way runs the install script as a computer startup script. Its lines are:

  1. Download the install script and put it where the computers can read it. Each platform has its own Download the install script link.
  2. Edit the GPO that applies to the computers. In Group Policy Management: Computer Configuration, Policies, Windows Settings, Scripts (Startup/Shutdown), Startup.
  3. Add the script with your key. Open the PowerShell Scripts tab, press Add, choose the script, and put -EnrollmentKey followed by your key in Script Parameters. The page shows the exact text, with a Copy button.
  4. Restart a test computer. Startup scripts run at boot.

Install with the script (RMM or by hand)

The Script card suits a remote management tool that runs PowerShell, or one computer by hand. The install script downloads the package, checks it against the SHA-256 and against the publisher, and only then installs it. Its lines are:

  1. Copy the command for your computers. Each platform has its own command, with a Copy button, and a Download the install script link.
  2. Run it as Administrator, or as the system account from your remote management tool.

While a key is on screen, or after you paste one, the command is one line that carries the key and needs no file. Otherwise the page shows the command for the saved script, with the placeholder:

powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\Install-StackJackAgent.ps1 -EnrollmentKey <your enrollment key>

For some packages the one-line form is too long. The page then says so and shows the command for the saved script: save the install script, then run the command in the folder that holds it.

The script ends with one of these codes:

CodeWhat happened
0The agent is installed.
30The download failed. Check that the computer can reach the StackJack download host.
31The download did not match its SHA-256. Nothing was installed.
32The download is not signed by the publisher the page names. Nothing was installed.
33The installer failed. Read the Windows Installer log.

While the installer runs, the enrollment key is visible to administrators of that machine. It only lets a device ask to join your organization. It gives no access to your data.

Install the MSI yourself

Use the MSI when your RMM, Intune or another endpoint product deploys MSI packages. Download it with Download the MSI on the Microsoft Intune card, check its SHA-256 (Show the checksum) and its signature, upload it to your product, and give it this command. The file name carries the version and the platform.

msiexec /i "StackJackEndpointAgent-<version>-win-x64.msi" /qn /norestart ENROLLMENTKEY="<your enrollment key>" /l*v "%WINDIR%\Temp\endpoint-agent-install.log"

At the end of step 2, MSI settings, for people who deploy it another way lists the MSI's own settings and the silent install and removal commands:

SettingWhat it does
ENROLLMENTKEY=<key>Your enrollment key. Without it the agent installs but does not join your organization.
UNINSTALLCODE=<code>Only for a removal, and only when your organization set an uninstall code. Not needed to install or to upgrade.
/qnSilent: no windows.
/norestartNo restart. The agent never needs one.
/l*v <file>Writes a detailed Windows Installer log to the file.

In Intune, add the MSI as a line-of-business app and put ENROLLMENTKEY=<your enrollment key> in the command-line arguments.

The only two properties the package reads are ENROLLMENTKEY and UNINSTALLCODE. Windows Installer keeps both out of its log. The package refuses a key that does not look like an enrollment key, and the install then fails at once. A wrong key is found at install time, not weeks later as a computer that never joins. Code 3010 means Windows wants a restart. The agent does not need one.

What the package puts on a computer

WhatWhere or how
The agent program and your brand fileC:\Program Files\StackJack\EndpointAgent
The agent serviceA Windows service that runs as the system account and starts by itself. If it stops without being asked, Windows starts it again.
The command on the PATHThe install folder joins the system PATH, so tools can run the stackjack-agent command by name.
The helper for the person signed inA start entry for every user. The helper starts hidden at each sign-in. A person who is already signed in when you install gets the helper at the next sign-in.
The agent's dataA folder under C:\ProgramData, named for the brand. The cached policy is in a part that every user can read, because the hooks need it. It holds no secret. The part with the enrollment key and the device credential is open to administrators only.
The browser linkRegistry entries so Chrome, Edge and Firefox can start the agent for the browser extension. The Chrome and Edge entries exist only when your brand has a Chrome extension id.
A hosts cleanup taskA scheduled task named "your product name, then hosts cleanup" that runs every 15 minutes as the system account. See below.

Every brand keeps the StackJack name for the service, the install folder and the command in this release. The service is named stackjack-agent, the folder is C:\Program Files\StackJack\EndpointAgent, and the command is stackjack-agent, whatever brand the package carries. Only the product name, the publisher, the icon and the tray text are the brand's. A person who looks at the computer's services or at its folders sees the StackJack name there.

The package does not turn the browser extension on. For that, see Installing the browser extension.

The enrollment key is used once

The agent reads the key from a file that only administrators can read, asks StackJack for its own device credential, and then deletes the file. After that the key is not needed on the computer. For a short time after the agent enrolls, StackJack cannot yet check the new device. During that time the agent allows everything and records that nothing was checked. The device then shows as healthy in the Devices list.

If a key is stolen, rotate it. The old key keeps working for 7 days so installs in progress can finish. Devices that already enrolled are not affected. To end one device, revoke it on its own.

Security products and the agent

Your security product may ask about the agent. These are the facts it sees:

  • The program and the package are signed by the publisher of your package: your own certificate if you brand and sign the agent, and ours if you do not. Allow that certificate.
  • The agent starts the helper through a small script file (a hidden launch from the machine start entry). If your policy turns off Windows Script Host, the helper does not start. The service and the discovery still work.
  • The paste check installs a keyboard hook only while an AI app is the window in front, and it acts only on the two paste shortcuts. Some security products flag any keyboard hook, so allow the signed agent.
  • The hosts cleanup task runs PowerShell as the system account every 15 minutes. It takes the agent's own section out of the hosts file when the agent has stopped for good. It never runs the agent.
  • AI site control writes only a clearly marked section of the hosts file. Every other line of the file stays as it was.

To tell a security product to hand a job to the product instead, see Use your security product with the endpoint agent.

Check one computer

In a new command window on the computer, run:

stackjack-agent status

It prints the version, the platform, whether the brand file was found, the organization, whether a credential is present, the age of the policy, the mode, the capture level, and whether the service answered. It prints no key, no token and no path under a person's profile. A person without administrator rights cannot read the credential folder, so the line "credential present" says it cannot tell, and it does not say "no". The command ends with 0 when the service answered, 65 when there is no brand file, and 69 when the service did not answer.

Updating

By default each agent updates itself. To move computers yourself, run the new package over the old one:

msiexec /i StackJackEndpointAgent-<new version>-win-x64.msi /qn

A replacement needs no uninstall code, even when you set one. The installer treats it as an upgrade, not as a removal. Run the same command from your RMM to move computers to a new version, to a new signer, or to another brand. The uninstall code lock covers a removal only.

A package of another brand at the same version also replaces the installed one. All brands of the agent share one install folder and one service, so the new package takes the place of the old one and does not install next to it.

Removing the agent

Remove it with the same package file, or with its product code:

msiexec /x "StackJackEndpointAgent-<version>-win-x64.msi" /qn /norestart UNINSTALLCODE="<your code>"
  • If you set an uninstall code, the removal needs it. With a wrong or missing code, Windows Installer ends with error 1603 and nothing is removed. The agent's data folder then holds a short line in installer.log that says the removal was refused.
  • If you set no code, the removal needs none. Anyone with administrator rights can remove the agent.
  • A removal takes the agent's section out of the hosts file, takes out the service, the start entry and the PATH entry, and removes the hosts cleanup task. If the cleanup cannot finish, the task stays and finishes the job within about 15 minutes, and then removes itself.
  • A removal deletes the credential folder of the agent's data folder: the device credential and any enrollment key file in it. A computer that you install again must enroll again, so give it a current enrollment key. An upgrade by a new package is not a removal and keeps the credential.
  • The rest of the agent's data folder under C:\ProgramData (the log and the cached policy) stays. Delete it by hand if you want it gone.

When something does not work

You seeCheck
The computer never appears on the Devices tabThe key may be revoked or retired. Make a new one. Check that the computer can reach StackJack. Run stackjack-agent status.
The install fails at once with the keyThe value is not shaped like an enrollment key. Copy it again from the page.
The tray item is missingThe helper starts at sign-in. Sign out and in again. If Windows Script Host is off by policy, the helper cannot start.
The removal ends with 1603An uninstall code is set and the one given is wrong or missing.