Loading

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…

2 thoughts on “Force sync all AAD joined devices”
  1. Is this a Powershell that you run from an admin computer where install-module and/or import-module are needed?

    Thanks!

    1. Hi Jay,
      This is the worst part of powershell imo lol. Finding the module.

      Microsoft.Graph.Intune

      This is probably the module you need to import/install for the gallery.

Leave a Reply

Your email address will not be published. Required fields are marked *