# Microsoft Intune connector thinklet

Configure Microsoft Intune connector thinklets to take specific actions within your workflow.

{% hint style="info" %}
Refer to the [Permissions](https://learn.microsoft.com/en-us/graph/api/intune-devices-manageddevice-get?view=graph-rest-1.0#permissions) section in the Microsoft documentation to view the required authorizations.
{% endhint %}

## Action: Get device enrollment details <a href="#microsoftoutlookconnectorthinklet-action-sendanemailtoonerecipient" id="microsoftoutlookconnectorthinklet-action-sendanemailtoonerecipient"></a>

**Get device enrollment details** verifies that Microsoft Intune manages a device, and retrieves Microsoft Intune device properties. These properties include the managed device ID, enrollment type, enrollment date and time, and ownership type.

The Microsoft Intune connector thinklet relies on the [Get managedDevice](https://learn.microsoft.com/en-us/graph/api/intune-devices-manageddevice-get?view=graph-rest-1.0) API endpoint provided by Microsoft Graph.

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

* **Parameters**
  * **Device name**: The device for which you want to obtain the properties.
* **Outputs**
  * **ID (**`ManagedDeviceId`**):** A managed device ID indicating that the device exists in Microsoft Intune.
  * **Enrollment type (**`EnrollmentType`**):** Indicates the type of device enrollment, such as user-driven enrollment, Entra ID enrollment, or other.
  * **Enrollment date and time (**`EnrollmentDateTime`**):** Time and date the device was enrolled in Microsoft Intune.
  * **Ownership type (**`OwnershipType`**):** Indicates whether this device belongs to an individual, a company, or an unknown person.

The table below shows the API Service connector details needed when recreating the connector:

<table><thead><tr><th width="272">Field</th><th>Value</th><th data-hidden></th></tr></thead><tbody><tr><td>Resource Path</td><td><code>/deviceManagement/managedDevices?$filter=(deviceName eq '{{DeviceName}}')&#x26;$select=id,enrolledDateTime,deviceEnrollmentType,managedDeviceOwnerType</code></td><td></td></tr><tr><td>Method</td><td>GET</td><td></td></tr><tr><td>Payload</td><td></td><td></td></tr><tr><td>Outputs</td><td><p><code>EnrollmentType $.value[0].deviceEnrollmentType EnrollmentDateTime $.value[0].enrolledDateTime ManagedDeviceId $.value[0].id</code></p><p><code>OwnershipType $.value[0].managedDeviceOwnerType</code></p></td><td></td></tr></tbody></table>

## Action: **Get device compliance state** <a href="#microsoftoutlookconnectorthinklet-action-sendanemailtotworecipients" id="microsoftoutlookconnectorthinklet-action-sendanemailtotworecipients"></a>

**Get device compliance state** retrieves a managed device's compliance status and details. These details include the device compliance state and device encryption state.

The Microsoft Intune connector thinklet relies on the [Get managedDevice](https://learn.microsoft.com/en-us/graph/api/intune-devices-manageddevice-get?view=graph-rest-1.0) API endpoint provided by Microsoft Graph.

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

* **Parameters**
  * **Device name**: The device for which you want to obtain the properties.
* **Outputs**
  * **Device compliance state (**`DeviceComplianceState`**):** Indicates whether the device complies with Microsoft Intune policies.
  * **Device encryption state (**`DeviceEncryptionState`**):** Indicates whether the device is encrypted.

The table below shows the API Service connector details needed when recreating the connector:

<table><thead><tr><th width="272">Field</th><th>Value</th><th data-hidden></th></tr></thead><tbody><tr><td>Resource Path</td><td><code>/deviceManagement/managedDevices?$filter=(deviceName eq '{{DeviceName}}')&#x26;$select=complianceState,jailBroken,isEncrypted</code></td><td></td></tr><tr><td>Method</td><td>GET</td><td></td></tr><tr><td>Payload</td><td></td><td></td></tr><tr><td>Outputs</td><td><code>DeviceComplianceState $.value[0].complianceState DeviceEncryptionState $.value[0].isEncrypted</code></td><td></td></tr></tbody></table>

Refer to the [Configuring connector thinklets](https://docs.nexthink.com/platform/user-guide/workflows/creating-workflows/configuring-connector-thinklet) documentation for more information about connector thinklets.
