> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getunbound.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Microsoft Intune

> Deploy Unbound to Windows devices with Intune

Intune **Remediations** runs the installer daily, so devices stay onboarded and re-apply if their setup drifts.

## Before you begin

* Remediations needs Windows Enterprise E3/E5, Education A3/A5, or Windows VDA per user. Without one, use the [scheduled task](#no-remediations-licence) below.
* The installer is Python-based, so Python 3 must be on every device before the first run. [Step 0](#0-install-python) deploys it as a Win32 app.
* Allow HTTPS to `getunbound.ai`, `backend.getunbound.ai`, `api.getunbound.ai`, `raw.githubusercontent.com`, `github.com` and `codeload.github.com` (the discovery download redirects there).

***

## 0. Install Python

Download the 64-bit installer from [python.org](https://www.python.org/downloads/windows/) and wrap it into a `.intunewin` with Microsoft's [IntuneWinAppUtil](https://github.com/microsoft/Microsoft-Win32-Content-Prep-Tool) on any Windows PC. Then create the app under **Apps → Windows → Add → Windows app (Win32)**:

| Field | Value |
| - | - |
| Install command | `python-3.14.10-amd64.exe /quiet InstallAllUsers=1 PrependPath=1 Include_launcher=1 Include_test=0` |
| Uninstall command | `python-3.14.10-amd64.exe /quiet /uninstall` |
| Install behavior | **System** |
| Operating system architecture | **64-bit** |
| Detection rule | **File** · path `C:\Program Files\Python314` · file `python.exe` · **File or folder exists** · 32-bit app on 64-bit clients: **No** |
| Assignment | **Required**, to the same device group as the remediation below |

Keep all three install flags. `InstallAllUsers=1` puts Python where SYSTEM can see it, and `Include_launcher=1` puts `py.exe` in `C:\Windows`, so the remediation finds it without a reboot even if Python landed minutes earlier. Replace `3.14.10` and `Python314` with the version you downloaded.

***

## 1. Get your API key

Sign in to Unbound as an admin and open [Configure](https://gateway.getunbound.ai/configure). Under **Choose scope** select **My org (MDM)**, then under **Run the install command** select the **Windows** tab and copy the command. Your key is the value after `-ApiKey`. Click **Copy MDM Key** to copy it. If your command also carries `-BackendUrl`, `-GatewayUrl` or `-FrontendUrl` (a dedicated deployment), add the same switches after `-ApiKey` in both scripts below. Drop `-Backfill` if **Seed events from past activity** is off in Configure.

***

## 2. Save the two scripts

`Detect_Unbound.ps1` — tells Intune whether the device needs a run:

```powershell theme={null}
$base = 'C:\Program Files\Unbound'
$marker = Join-Path $base 'last-success.txt'
$owned = (Test-Path $marker) -and
    ((Get-Acl $base).GetOwner([Security.Principal.SecurityIdentifier]).Value -in @('S-1-5-18', 'S-1-5-32-544'))
if ($owned -and ((Get-Date) - (Get-Item $marker).LastWriteTime).TotalHours -lt 20) {
    Write-Output "Unbound: ran $((Get-Item $marker).LastWriteTime)"; exit 0
}
Write-Output "Unbound: needs a run"; exit 1
```

`Remediate_Unbound.ps1` — runs the installer and records the result, replacing `YOUR_ADMIN_API_KEY` with your key:

```powershell theme={null}
$base = 'C:\Program Files\Unbound'
New-Item -ItemType Directory -Force -Path $base | Out-Null
icacls $base /setowner '*S-1-5-32-544' /T /C | Out-Null
icacls $base /reset /T /C | Out-Null
icacls $base /inheritance:r /grant:r '*S-1-5-18:(OI)(CI)F' '*S-1-5-32-544:(OI)(CI)F' | Out-Null
$acl = Get-Acl $base
$allowed = @('S-1-5-18', 'S-1-5-32-544')
if ($acl.GetOwner([Security.Principal.SecurityIdentifier]).Value -notin $allowed -or
    ($acl.Access | Where-Object {
        $_.IdentityReference.Translate([Security.Principal.SecurityIdentifier]).Value -notin $allowed })) {
    throw "Could not secure $base. Refusing to continue."
}
Remove-Item (Join-Path $base '*') -Force -Recurse -ErrorAction SilentlyContinue

$installer = Join-Path $base 'onboard.ps1'
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest -Uri 'https://getunbound.ai/setup/mdm/windows/onboard' -OutFile $installer -UseBasicParsing -ErrorAction Stop

& $installer -ApiKey 'YOUR_ADMIN_API_KEY' -Backfill
$code = $LASTEXITCODE

if ($code -eq 0) {
    try { Set-Content -Path (Join-Path $base 'last-success.txt') -Value (Get-Date -Format 'o') -ErrorAction Stop }
    catch { Write-Output "Installed, but could not write the marker. $_"; $code = 1 }
}
Remove-Item $installer -Force -ErrorAction SilentlyContinue
exit $code
```

Replace `YOUR_ADMIN_API_KEY` with the key from step 1, and save both files as UTF-8 without a BOM.

***

## 3. Create the package

**Devices → Manage devices → Scripts and remediations → Create script package**

**1. Basics**

Name it `Unbound daily onboard`.

**2. Settings**

Upload both scripts. Set **Run this script using the logged-on credentials: No**, **Enforce script signature check: No**, **Run script in 64-bit PowerShell: Yes** — a 32-bit host redirects `C:\Program Files` to `C:\Program Files (x86)`.

**3. Assignments**

Select your developer device group, then the ellipsis beside it → **Edit** → **Schedule: Daily** → **Apply**. Finish with **Review + create**.

To run it on one device now: **Devices → By platform → Windows →** the device **→ … → Run remediation (preview)**. Otherwise it runs at the next check-in — after a restart, after a sign-in, or within 8 hours.

***

## 4. Verify

> [card] Intune
>
> **Scripts and remediations → Unbound daily onboard → Device status** shows **Without issues**.

> [card] Device
>
> `C:\Program Files\Unbound\last-success.txt` updates daily.

> [card] [Unbound](https://gateway.getunbound.ai/settings?tab=devices)
>
> Devices appear on **Settings → Devices**, and show a recent **Last Sync** on AI Tools Discovery.

***

## Troubleshooting

| Symptom | Fix |
| - | - |
| `Python 3 is required but not found in PATH` | The Python app has not installed yet, or it was deployed without `Include_launcher=1`. Check its status under **Apps**, re-deploy with the flags in [Step 0](#0-install-python), then run the remediation again. |
| Device appears as `SERIAL@yourdomain` with no owner | The remediation runs as SYSTEM, so the owner comes from your serial → email mapping. Upload it with **Import Devices** on **Settings → Devices**; the next daily run moves the device to that user. If JumpCloud is connected it is the only owner source, so add the serial to its inventory instead (see [Placeholder users](https://docs.getunbound.ai/mdm-integrations/overview.md#placeholder-users)). |
| `Could not download` or a `404`/`403` on `raw.githubusercontent.com` | The installer fetches its Python stage from GitHub. Allow `raw.githubusercontent.com` through your proxy, including TLS inspection. |
| Remediation shows **Failed** | Open the device under **Device status** and read the output. It names the step that failed. |
| Copilot rows show `auto` | Allow one daily cycle. Sessions VS Code has already rotated cannot be read. |

***

## Command switches

| Switch | Purpose | Default |
| - | - | - |
| `-ApiKey <key>` | Your admin API key. Required unless `-Clear` | — |
| `-BackendUrl <url>` | Where setup results and scans are reported | `https://backend.getunbound.ai` |
| `-GatewayUrl <url>` | The AI gateway the installed tools point at | `https://api.getunbound.ai` |
| `-FrontendUrl <url>` | Your dashboard host, written into each user's config | `https://gateway.getunbound.ai` |
| `-Backfill` | Import past Claude Code, Codex and GitHub Copilot sessions | off |
| `-SkipManagedSettings` | Claude Code only: install the hook, leave its managed settings to you. See [Tamper Resistance](https://docs.getunbound.ai/mdm-integrations/tamper-resistance.md#when-your-claude-code-policy-is-managed-elsewhere) | off |
| `-Clear` | Remove the configuration for every tool | off |

***

## No Remediations licence

A Platform script runs **once** per device, so deploy this script instead and let it create a daily scheduled task.

**Devices → Scripts and remediations → Platform scripts → Add → Windows 10 and later**, with **logged on credentials: No**, **signature check: No**, **64-bit PowerShell host: Yes**.

> [accordion] Scheduled task script
>
> ```powershell theme={null}
> $base = 'C:\Program Files\Unbound'
> New-Item -ItemType Directory -Force -Path $base | Out-Null
> icacls $base /setowner '*S-1-5-32-544' /T /C | Out-Null
> icacls $base /reset /T /C | Out-Null
> icacls $base /inheritance:r /grant:r '*S-1-5-18:(OI)(CI)F' '*S-1-5-32-544:(OI)(CI)F' | Out-Null
> $acl = Get-Acl $base
> $allowed = @('S-1-5-18', 'S-1-5-32-544')
> if ($acl.GetOwner([Security.Principal.SecurityIdentifier]).Value -notin $allowed -or
>     ($acl.Access | Where-Object {
>         $_.IdentityReference.Translate([Security.Principal.SecurityIdentifier]).Value -notin $allowed })) {
>     throw "Could not secure $base. Refusing to write the API key."
> }
> Remove-Item (Join-Path $base '*') -Force -Recurse -ErrorAction SilentlyContinue
> $runner = Join-Path $base 'run-unbound.ps1'
>
> @'
> $installer = 'C:\Program Files\Unbound\onboard.ps1'
> [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
> Invoke-WebRequest -Uri 'https://getunbound.ai/setup/mdm/windows/onboard' -OutFile $installer -UseBasicParsing -ErrorAction Stop
> & $installer -ApiKey 'YOUR_ADMIN_API_KEY' -Backfill
> $code = $LASTEXITCODE
> if ($code -eq 0) {
>     try { Set-Content -Path 'C:\Program Files\Unbound\last-success.txt' -Value (Get-Date -Format 'o') -ErrorAction Stop }
>     catch { Write-Output "Installed, but could not write the marker. $_"; $code = 1 }
> }
> Remove-Item $installer -Force -ErrorAction SilentlyContinue
> exit $code
> '@ | Set-Content -Path $runner -Encoding UTF8
>
> $action    = New-ScheduledTaskAction -Execute 'powershell.exe' -Argument "-NoProfile -ExecutionPolicy Bypass -File `"$runner`""
> $trigger   = New-ScheduledTaskTrigger -Daily -At 9:00am
> $settings  = New-ScheduledTaskSettingsSet -StartWhenAvailable -RunOnlyIfNetworkAvailable -MultipleInstances IgnoreNew -ExecutionTimeLimit (New-TimeSpan -Hours 5)
> $principal = New-ScheduledTaskPrincipal -UserId 'SYSTEM' -LogonType ServiceAccount -RunLevel Highest
> Register-ScheduledTask -TaskName 'Unbound Daily Onboard' -Action $action -Trigger $trigger -Settings $settings -Principal $principal -Force -ErrorAction Stop | Out-Null
> Start-ScheduledTask -TaskName 'Unbound Daily Onboard' -ErrorAction Stop
> ```

Confirm the Platform script's **Device status** reads **Success**, Task Scheduler lists `Unbound Daily Onboard` with **Last Run Result 0x0**, and the device appears in Unbound.

***

## Remove Unbound

Remove the Intune assignment first, or the next check-in reinstalls. Then, in an elevated PowerShell on the device:

```powershell theme={null}
Invoke-WebRequest -Uri 'https://getunbound.ai/setup/mdm/windows/onboard' -OutFile onboard.ps1 -UseBasicParsing; .\onboard.ps1 -Clear
Remove-Item 'C:\Program Files\Unbound' -Recurse -Force
```

If you used the scheduled task, also run:

```powershell theme={null}
Unregister-ScheduledTask -TaskName 'Unbound Daily Onboard' -Confirm:$false
```

> [card] [Tamper Resistance](https://docs.getunbound.ai/mdm-integrations/tamper-resistance.md)
>
> Keeping Unbound active on every device with managed settings.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.