> For the complete documentation index, see [llms.txt](https://docs.realmjoin.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.realmjoin.com/automation/runbooks/runbook-references/device/general/sync-device.md).

# Sync Device

Trigger an Intune sync on this device

### Description

Asks this device to check in with Intune, so pending policies, apps and configuration are applied without waiting for the next regular check-in. The device name, operating system, primary user and last check-in are shown first. If this device is offline, it syncs when it comes back online. The device must be enrolled in Intune.

### How it works

The runbook looks up this device in Intune by its Entra ID device ID, shows its current state and sends the same sync request as **Sync** in the Intune admin center. Intune wakes the device through the push service of its platform; the device then checks in, applies pending policies, apps and configuration and reports its state back. An offline device receives the request when it comes back online. The last check-in time in Intune changes only after the check-in has completed.

If an earlier enrollment left more than one Intune record with the same Entra ID device ID, the sync request goes to the record that checked in last and the run shows a warning. Remove the stale records in the Intune admin center.

### Sync without the RealmJoin app permission

The **Sync** button in the [device details](https://docs.realmjoin.com/ugd-management/user-list/device-details) of the RealmJoin Portal asks Intune through the RealmJoin app, which then needs the Intune permission for remote actions on devices. This runbook sends the request with the managed identity of the Automation account instead. Use it when the RealmJoin app does not hold that permission but help desk staff should still be able to sync a device. Who may start the runbook is controlled by the runbook permissions in RealmJoin.

### Location

Device → General → Sync Device

**Full Runbook name**

rjgit-device\_general\_sync-device

### Details

| Property         | Value                                                                                    |
| ---------------- | ---------------------------------------------------------------------------------------- |
| Version          | 1.0.0                                                                                    |
| Required modules | <p>RealmJoin.RunbookHelper (>= 0.8.10)<br>Microsoft.Graph.Authentication (>= 2.41.2)</p> |
| Schedulable      | no                                                                                       |

### Permissions

#### Application permissions

* **Type**: Microsoft Graph
  * DeviceManagementManagedDevices.PrivilegedOperations.All
    * *Sends the sync request to the device via POST /deviceManagement/managedDevices/{id}/syncDevice*
  * DeviceManagementManagedDevices.Read.All
    * *Finds the Intune record of this device by azureADDeviceId and reads its name, operating system, primary user, compliance state and last check-in*

### Parameters

#### DeviceId

Entra ID device ID of the device the runbook acts on. Set by the portal from the selected device.

| Property         | Value                                  |
| ---------------- | -------------------------------------- |
| Required         | true                                   |
| Default Value    |                                        |
| Type             | String                                 |
| Hidden in portal | yes (preset via runbook customization) |

[Back to Runbook Reference overview](https://docs.realmjoin.com/automation/runbooks/runbook-references.md)


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.realmjoin.com/automation/runbooks/runbook-references/device/general/sync-device.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
