Answer · Low impact

OneDrive sync: files fail with name or path errors

Symptom

The OneDrive icon shows sync problems on a few files, often after Known Folder Move was turned on or after a migration.

Cause

File names with characters or names that are not allowed, or full paths longer than the 400 character limit, often from deeply nested folders.

Resolution

  1. Open the OneDrive activity centre and read the list of files with problems.

  2. Rename files with invalid characters or names.

  3. Shorten folder names or move deep folders closer to the root.

  4. Check that Known Folder Move completes before any device reset.

Disclaimer. These samples are provided as is, without warranty of any kind. Read and test every script in a non-production tenant before you run it, and run reports before any command that changes or deletes data.