> For the complete documentation index, see [llms.txt](https://help.aikido.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.aikido.dev/aikido-device-protection/deploying-aikido-endpoint/device-protection-mdm-guides/windows/deploy-aikido-endpoint-with-primo.md).

# Deploy Device Protection with Primo

Use Primo to deploy Aikido Device Protection across your managed Windows fleet with the required permissions in place.

{% hint style="info" %}
All devices must be enrolled in Primo Windows management before you begin.
{% endhint %}

## Installation

{% stepper %}
{% step %}
**What you'll need**

Before starting, make sure you have the following from the Aikido Device Protection dashboard:

* Your **PowerShell install command** (copied from the user group selector on the dashboard, includes token + installer download)

If you're missing it, go back to the [Aikido Device Protection dashboard](https://app.aikido.dev/endpoint-protection/devices), click **Connect Device**.
{% endstep %}

{% step %}
**Run the install command on managed devices**

Primo runs PowerShell scripts on Windows hosts through the Controls library. Upload the dashboard command as a `.ps1` script, then run it against your target devices.

1. In the Primo admin console, go to **MDM** → **Controls** → **Scripts**.
2. Copy the PowerShell install command from the Aikido Device Protection dashboard. Save it as a `.ps1` file (e.g. `aikido-install.ps1`), then click **Add script**, upload the file, and give it a name (e.g. "Aikido Device Protection install").
3. Assign the script to the team or device group that should receive Aikido Device Protection.
4. Go to **Hosts**, filter to your target Windows devices, select them, open the **Actions** menu, and choose **Run script**. Select the Aikido install script.
5. Wait for the run to finish. Open the script run results and confirm every targeted device reports success before continuing.
   {% endstep %}

{% step %}
**Apply the lockdown policy**

End users must not be able to stop the Aikido service or uninstall the Aikido Device Protection app.

**Block uninstallation of Aikido Device Protection**

Run a PowerShell script that downloads and applies the AppLocker policy.

1. In the Primo admin console, go to **MDM** → **Controls** → **Scripts**.
2. Click **Add script**, name it (e.g. "Aikido uninstall block"), and paste the following:

```powershell
$tmp = "$env:TEMP\aikido-applocker.xml"
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/AikidoSec/safechain-internals/refs/heads/main/docs/aikido-applocker-deny-mdm.xml" -OutFile $tmp
Set-AppLockerPolicy -XmlPolicy $tmp -Merge
Remove-Item $tmp -Force
```

3. Apply it to your target Windows device group.
   {% endstep %}

{% step %}
**Reboot devices after installation**

Add a reboot step to the install script: open the Aikido install script in **MDM** → **Controls** → **Scripts** (or add a follow-up script) and append `Restart-Computer -Force` so the device reboots at the end of the run.

The agent fully activates on the next boot.
{% endstep %}
{% endstepper %}

## Troubleshooting

| Problem                                                      | Fix                                                                                                                                                                             |
| ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Device doesn't appear in the dashboard after the script runs | Reboot the device; the agent fully registers on the next boot                                                                                                                   |
| Script exits with an error in the MDM console                | Run the script manually as SYSTEM on a test host to see the full error; confirm the device has internet access to download the installer                                        |
| Agent service is not running                                 | Reboot the device; if the service is still absent, re-run the install script                                                                                                    |
| Script is blocked by execution policy                        | Scripts run via MDM execute as SYSTEM and bypass user-level execution policy restrictions; confirm the MDM is not applying an additional policy that restricts script execution |
| Device shows as inactive after installation                  | The agent needs a reboot to fully activate; check back after rebooting                                                                                                          |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.aikido.dev/aikido-device-protection/deploying-aikido-endpoint/device-protection-mdm-guides/windows/deploy-aikido-endpoint-with-primo.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
