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

# Intune Deployment

> Deploy automatic configuration provisioning to Windows devices managed by Microsoft Intune

## Prerequisites

* Microsoft Intune admin access
* Enrollment key from Runlayer
* Devices running Windows 10 1607+ or Windows 11, Microsoft Entra joined
* The signed [Runlayer CLI MSI](https://docs.runlayer.com/deploy-cli/intune.md) deployed to target devices

> [accordion] Creating an Enrollment Key
>
> Enrollment keys allow devices to automatically register with Runlayer and obtain API credentials.
>
> ![Enrollment Keys List](https://mintcdn.com/anysource/6y8VzDSWjckfUDpB/images/enrollment-keys-list.png?fit=max\&auto=format\&n=6y8VzDSWjckfUDpB\&q=85\&s=e6e9bf9618213fc75b9e4db86c44f28b)
>
> **1. Navigate to Enrollment Keys**
>
> Go to **Settings** in the Runlayer dashboard and select the **Enrollment Keys** tab
>
> **2. Create a New Key**
>
> Click **+ Create Enrollment Key**
>
> ![Create Enrollment Key](https://mintcdn.com/anysource/6y8VzDSWjckfUDpB/images/enrollment-key-create.png?fit=max\&auto=format\&n=6y8VzDSWjckfUDpB\&q=85\&s=18f53ec6ae775870c77a40f3a2b21cc3)
>
> **3. Configure the Key**
>
> * **Name** (required): Enter a descriptive name (e.g., "Production MDM")
> * **Description** (optional): Add context about the key's purpose
>
> **4. Copy the Key**
>
> Copy the generated key (starts with `rl_enroll_`) and store it securely
>
> ![Enrollment Key Created](https://mintcdn.com/anysource/6y8VzDSWjckfUDpB/images/enrollment-key-created.png?fit=max\&auto=format\&n=6y8VzDSWjckfUDpB\&q=85\&s=3bb1fd346da4bd7717d1dbef8be9a56d)
>
> > [!WARNING]
> >
> > Enrollment keys are shown only once. Store them securely and treat them like passwords.

> [!NOTE]
>
> Windows Home and S mode are not supported.

## Deployment Methods

Intune supports two deployment methods. Choose based on your license:

* **Platform Script** — available with all Intune licenses. Creates a Windows Scheduled Task for recurring sync.
* **Remediation** — requires Intune P2 (or add-on). Intune handles scheduling natively; no scheduled task is created on the device.

## Deployment Steps

**1. Generate the Script**

Fill in your settings below to generate a deployment script. Select your deployment method (Platform Script or Remediation). The generated script uses `C:\Program Files\Runlayer\CLI\runlayer.exe` and exits with an error if the MSI prerequisite is missing.

* `ENROLLMENT_USERNAME`: Leave empty to use `%USERNAME%`.
* `ENROLLMENT_DEVICE_NAME`: Leave empty to use `%COMPUTERNAME%`.

#### Config Sync Script Configuration

Fill in your settings to generate a customized configuration sync script

Runlayer Host URL \*

Your Runlayer instance URL

Enrollment API Key \*

Created in Settings → Enrollment Keys

Enrollment Username

MDM variable like $EMAIL or $USER\_PRINCIPAL\_NAME

Device Name

MDM variable like $DEVICE_NAME or $SERIAL\_NUMBER

**2. Add Script in Intune**

> [tab] Platform Script
>
> * Open the [Intune admin center](https://intune.microsoft.com)
> * Go to **Devices** > **Scripts and remediations** > **Platform scripts**
> * Click **Add** > **Windows 10 and later**
> * Upload the generated script
> * Set **Run this script using the logged on credentials** to **Yes**
> * Set **Run script in 64-bit PowerShell host** to **Yes**

> [tab] Remediation
>
> * Open the [Intune admin center](https://intune.microsoft.com)
> * Go to **Devices** > **Scripts and remediations** > **Remediations**
> * Click **Create script package**
> * Upload the generated script as the **Detection script**
> * Leave **Remediation script** empty
> * Set **Run this script using the logged-on credentials** to **Yes**
> * Set **Run script in 64-bit PowerShell host** to **Yes**

**3. Assign to Groups**

> [tab] Platform Script
>
> Select the device groups that should receive configuration sync, then click **Add**.

> [tab] Remediation
>
> Select the device groups, set the **schedule** (e.g. every 1 hour), then click **Create**.

## How It Works

> [tab] Platform Script
>
> The Intune platform script runs once per device and acts as a **bootstrapper**:
>
> 1. Verifies the packaged Runlayer CLI is installed and enrolls the device
> 2. Runs the config sync immediately
> 3. Creates a **Windows Scheduled Task** for recurring execution
>
> The `RunlayerConfigSync` task runs the packaged binary on the configured interval (default: 60 minutes). CLI updates are handled separately by the package-owned `\Runlayer\CLIUpdate` task when its [managed update configuration](https://docs.runlayer.com/deploy-cli/intune.md#managed-configuration-optional) is present; the sync task does not install or update the CLI.
>
> > [!NOTE]
> >
> > The scheduled task runs as the logged-on user. Scans and syncs only occur while a user is signed in.

> [tab] Remediation
>
> The Intune remediation detection script runs on the schedule you configure in Intune:
>
> 1. Verifies the packaged Runlayer CLI is installed
> 2. Stores credentials if not already configured
> 3. Runs config sync
> 4. Exits `0` (compliant) on success, `1` (non-compliant) on failure
>
> No scheduled task is created on the device. Intune's management agent handles all scheduling natively, and device compliance status is visible in the Intune admin console.

## Verification

> [tab] Platform Script
>
> Monitor script status in **Devices** > **Scripts and remediations** > **Platform scripts**. On a target device, open a client (e.g., Cursor) and confirm the synced MCP servers appear.
>
> To verify the scheduled task is running, open **Task Scheduler** on the device and look for `RunlayerConfigSync`. Logs are at `%ProgramData%\Runlayer\auto_provisioning.log`.

> [tab] Remediation
>
> Monitor detection status in **Devices** > **Scripts and remediations** > **Remediations** > select the script package > **Device status**. Devices reporting `0` (compliant) have successfully synced.
>
> Logs are at `%ProgramData%\Runlayer\auto_provisioning.log`.

## Troubleshooting

> [accordion] Script not running
>
> * Ensure the device is Microsoft Entra joined (not just registered)
> * Check that the Intune Management Extension service is installed
> * Verify the packaged CLI exists at `C:\Program Files\Runlayer\CLI\runlayer.exe`
> * Verify the device can reach your Runlayer host

> [accordion] Script reports success but no config changes
>
> * Check `%ProgramData%\Runlayer\auto_provisioning.log` for errors
> * Verify the enrollment API key is correct and not revoked
> * Confirm connectors or plugins have auto-sync enabled in the Runlayer dashboard

> [accordion] Enrollment fails with 401
>
> * Verify the enrollment API key is correct
> * Check if the key has been revoked in **Settings** > **Enrollment Keys**

> [accordion] Scheduled task not running (Platform Script only)
>
> * Open **Task Scheduler** and check `RunlayerConfigSync` status
> * Verify the recurring script exists at `C:\ProgramData\Runlayer\Scripts\`
> * Check logs at `%ProgramData%\Runlayer\`
> * The task only runs while the user is logged in

> [accordion] Remediation shows non-compliant
>
> * Check `%ProgramData%\Runlayer\auto_provisioning.log` for errors
> * A non-compliant status means the sync or a prerequisite failed — check the packaged CLI, network connectivity, and credentials
> * Verify the device can reach your Runlayer host


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