> For the complete documentation index, see [llms.txt](https://docs.nexthink.com/platform/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nexthink.com/platform/~/changes/Sh4xqs4GDClkDKT9Hvux/getting-started/installing-collector/installing-collector-on-macos/deploying-collector-on-macos-using-intune.md).

# Deploying Collector on macOS using Intune

Microsoft Intune is a cloud-based endpoint management solution. It supports macOS and allows remote installation of Collector using a shell script.

## Prerequisites <a href="#deployingcollectoronmacosusingintune-prerequisites" id="deployingcollectoronmacosusingintune-prerequisites"></a>

Read the online documentation from the Microsoft website to understand how to enroll macOS devices and learn about how shell scripts work:

1. [Endpoint management at Microsoft](https://learn.microsoft.com/en-us/mem/endpoint-manager-overview)
2. [Enroll your macOS device using the Company Portal app](https://learn.microsoft.com/en-us/mem/intune/user-help/enroll-your-device-in-intune-macos-cp)
3. [Use shell scripts on macOS devices in Intune](https://learn.microsoft.com/en-us/mem/intune/apps/macos-shell-scripts)

You need some basic knowledge of shell scripting to customize the script.

Before starting the deployment, ensure the devices have the appropriate policies using [the MDM profiles provided by Nexthink](/platform/~/changes/Sh4xqs4GDClkDKT9Hvux/getting-started/installing-collector/installing-collector-on-macos/installing-collector-profile-in-jamf-for-macos.md).

## The installation script <a href="#deployingcollectoronmacosusingintune-theinstallationscript" id="deployingcollectoronmacosusingintune-theinstallationscript"></a>

The install script provided below is an example of a recommended implementation. On each device, this script executes the following actions:

1. Downloads the specified Collector DMG file.
2. Checks the integrity of the downloaded file using a SHA256 hash.
3. Expands the DMG package.
4. Runs the CSI installer included in the package using specific parameters.
5. Verifies that the Collector services are running on the device.

[Download the install script template](https://download.nexthink.com/doc/intune.sh.zip) and adjust it to match the parameters specific to your IT infrastructure.

* Unzip the file and open the script template with a text editor.
* The script interpreter is Z shell, the default interpreter since macOS 10.15 (Catalina).
* Do not modify the lines below the `### Do not change from here ###` comment.

<figure><img src="https://268444917-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJSUDk9NTtCHYPG5EWs3%2Fuploads%2Fgit-blob-f436ab60131ccf220257a13e8625a43bedfa3964%2Fnxcheseaux-20230418-164307-2x-20230418-144307.png?alt=media" alt="" width="544"><figcaption></figcaption></figure>

## Adjusting the execution parameters <a href="#deployingcollectoronmacosusingintune-adjustingtheexecutionparameters" id="deployingcollectoronmacosusingintune-adjustingtheexecutionparameters"></a>

```
ALLOW_UPGRADE="new"
# Possible values of ALLOW_UPGRADE, if an existing version is installed:
# "new":          Only upgrade if there is a new version available
# "only-updater": Only upgrade old versions without auto-update
# "always":       Always overwrite an existing version
# "never":        Do not upgrade an existing version
CLEAN_INSTALL="false" # Discard any previously existing configuration
```

The first two parameters define how Collector manages any previous versions. Nexthink does not recommend modifying the default values.

* `ALLOW_UPGRADE`\
  Defines how the script manages upgrades. The default value is `new`.
* `CLEAN_INSTALL`\
  Defines whether Collector preserves the configuration of previous installations or not. The default value is `false`.

```
readonly COLLECTOR_URL="https://download.nexthink.com/releases/latest/OSX_Collector/Nexthink_Collector.dmg"
readonly COLLECTOR_SHA256="693adbeebdd172792e701765b607f36e6344ede18e421fe9e4162a1520f91497" # Get your hash string, for example from https://download.nexthink.com/releases/latest/OSX_Collector/Nexthink_Collector.dmg.sha256
readonly ADDRESS="" # Nexthink instance address, example: "nxdocs.data.eu.nexthink.cloud"
readonly TCP_PORT="" # Nexthink instance port, example: 443
readonly KEY="" # Your customer key: "-----BEGIN CUSTOMER KEY-----..."
```

The next parameters define the install configuration. See all the possible values on the [Installing Collector on macOS](/platform/~/changes/Sh4xqs4GDClkDKT9Hvux/getting-started/installing-collector/installing-collector-on-macos.md) page. Here is the list of mandatory parameters:

* `COLLECTOR_URL`\
  The URL of the Collector DMG package to be installed. Use [this link](https://download.nexthink.com/releases/latest/OSX_Collector/Nexthink_Collector.dmg) to always point to the latest version.
* `COLLECTOR_SHA256`\
  The SHA256 hash digest of the DMG file to verify the integrity and security of the download. Find it on the same download page as the DMG. The hash of the latest DMG is available using [this link](https://download.nexthink.com/releases/latest/OSX_Collector/Nexthink_Collector.dmg.sha256).
* `ADDRESS`\
  The address of the Nexthink instance.
* `TCP_PORT`\
  The port of the Nexthink instance.
* `KEY`\
  Your Customer Key, on a single line that begins with `-----BEGIN CUSTOMER KEY-----` and ends with `-----END CUSTOMER KEY-----`.

```
# Optional parameters:
readonly ROOT_CA="" # Only for old releases, leave empty if not needed
# Other install parameters to customize:
readonly OTHER_CSI_PARAMS="--engage enable \
    --use_assignment enable \
    --ra_execution_policy signed_trusted_or_nexthink \
    --anonymize_username false \
    --windows_focus_time_monitoring true \
    --user_interaction_time_monitoring enable \
    --anonymize_wifi_network false"

#################################
```

Finally, specify other configuration parameters in the `OTHER_CSI_PARAMS` section to override the previous configuration. The system passes these parameters to the CSI installer. Review the default values provided to ensure everything applies to your IT infrastructure, and check the list of supported parameters on the [Installing Collector on macOS](/platform/~/changes/Sh4xqs4GDClkDKT9Hvux/getting-started/installing-collector/installing-collector-on-macos.md) help page.

## Configuring the deployment <a href="#deployingcollectoronmacosusingintune-configuringthedeployment" id="deployingcollectoronmacosusingintune-configuringthedeployment"></a>

Log in to your Intune portal and click on **Devices**.

<figure><img src="https://268444917-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJSUDk9NTtCHYPG5EWs3%2Fuploads%2Fgit-blob-b209b2289c3850e8d3b8faeafc44b73e34175b03%2Fintune1.png?alt=media" alt="" width="680"><figcaption></figcaption></figure>

Navigate to **macOS**, then **Shell scripts**, and click on the **+ Add** button.

<figure><img src="https://268444917-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJSUDk9NTtCHYPG5EWs3%2Fuploads%2Fgit-blob-43d0bac47504991bdd822029becfa75f8dea0c34%2Fintune2.png?alt=media" alt=""><figcaption></figcaption></figure>

Under the **Basics** section, enter the name of the script, for example, `Install Collector`, and an optional description.

<figure><img src="https://268444917-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJSUDk9NTtCHYPG5EWs3%2Fuploads%2Fgit-blob-83e807f74f2323a207d2e44343734dbddca0fc7f%2Fintune3.png?alt=media" alt=""><figcaption></figcaption></figure>

Under **Script settings**, upload the script file. Leave the default values for the other fields.

<figure><img src="https://268444917-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJSUDk9NTtCHYPG5EWs3%2Fuploads%2Fgit-blob-9d587f10fc8bdaca76c0d1a506fc1399d59344e1%2Fintune4.png?alt=media" alt=""><figcaption></figcaption></figure>

Under **Scope tags,** add optional tags if needed.

<figure><img src="https://268444917-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJSUDk9NTtCHYPG5EWs3%2Fuploads%2Fgit-blob-47969df20727c248bec5a42f03c0deb64689a00b%2Fintune5.png?alt=media" alt=""><figcaption></figcaption></figure>

Under **Assignments**, select the groups to target.

<figure><img src="https://268444917-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJSUDk9NTtCHYPG5EWs3%2Fuploads%2Fgit-blob-e45ee13af06b71c267914f324c651a886682d878%2Fintune6.png?alt=media" alt=""><figcaption></figcaption></figure>

Lastly, carefully review the settings and click the **Add** button to finalize.

<figure><img src="https://268444917-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJSUDk9NTtCHYPG5EWs3%2Fuploads%2Fgit-blob-81cc6b90f27a588a22b230063a1b06e8a3679fd2%2Fintune7.png?alt=media" alt=""><figcaption></figcaption></figure>


---

# 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://docs.nexthink.com/platform/~/changes/Sh4xqs4GDClkDKT9Hvux/getting-started/installing-collector/installing-collector-on-macos/deploying-collector-on-macos-using-intune.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.
