
Onedrive for Business is most user’s gateway to cloud storage in Microsoft 365.
But sync errors are still a daily issue, and sometimes get worse when e.g. running virtualized (max 100k items), hitting large folders, long paths, or running locally with lots of syncs (max 1m items on preview).
Onedrive does not have a PS module or online console to monitor which users are stuck. Some approaches have been posted by the community, e.g:
- my and Rudy’s solution from ~2020 monitoring the sync state log file that can lag for days.
- Custom libraries that have dependencies and don’t remediate
- Reading the registry by Kelvin (no remediation, more a counter when you’re near a threshold)
- Microsoft’s sync dashboard as described by Florian (no remediation, lagged and very basic detection)
As I was seeing lots of stuck clients on AVD when users were adding links to Onedrive, I wanted to find a faster and more reliable method of detecting sync issues.
And why stop there? Remediation is around the corner… 🙂
So with Claude I went hunting and found a hook in the Windows 11 storage provider status API / cldapi.dll
This show the status and ability to hydrate files on demand, and progress.
Moving to remediation, it’s a fairly simple matter to monitor sync status and progress, and TEST a single small file hydration. If that is failing, Onedrive is stuck and needs a restart. For us, this has fixed a lot of stuck onedrive clients underneath RemoteApps in AVD 🙂
Links:
View and Remediate (Intune): https://github.com/jflieben/assortedFunctionsV2/blob/main/O4B/remediate-OneDriveHydration.ps1
View and Remediate (GPO/logon): https://github.com/jflieben/assortedFunctionsV2/blob/main/O4B/repair-OneDrive.ps1




