Force sync all AAD joined devices

,

We have all been here. It’s a common issue really and one that doesn’t have a simple “one-click” solution within Endpoint Manager.

So what you gonna do? It’s a simple solution really. Grab all of the devices from Azure and loop through them calling the Invoke-IntuneManagedDeviceSyncDevice cmdlet. This will only work for devices that are online at the time the invoke command is executed but sometimes this is the solution that’s needed.

$Devices = Get-IntuneManagedDevice -Filter "contains(operatingsystem, 'Windows')" | Get-MSGraphAllPages

Foreach ($Device in $Devices)
{

Invoke-IntuneManagedDeviceSyncDevice -managedDeviceId $Device.managedDeviceId
Write-Host "Sending Sync request to Device with DeviceID $($Device.managedDeviceId)" -ForegroundColor Yellow

}
ScriptCentral/Sync-AllDevices.ps1 at master · leeburridge/ScriptCentral (github.com)

Simple stuff. You could even run this as a scheduled task if you wanted devices to sync more often than the 8 hours that MS have by default…