Forum Discussion

IT-JACKIE's avatar
IT-JACKIE
Occasional Reader
Mar 12, 2026

Sharepoint Sync Onedrive - Long File Name issues

I need move some file from sharepoint to onedrive . i have add sharepoint folder to shortcut one drive . but when update on this device. , prompt up file long file name , need rename shorted after can sync . a lot of files.  I tried using PnPShell to try search long file name files . but the scripts does not work .Pls share other solution to solve out the isseus. 

 

 

1 Reply

  • virendrak's avatar
    virendrak
    Iron Contributor

    SharePoint Online allows very long paths (400 chars), OneDrive sync does not, it supports only 260 chars.

    1. Use SharePoint’s built‑in “Export to Excel” 

    This avoids PowerShell entirely.

    1. Go to the SharePoint library.
    2. Switch to List view (not Tiles).
    3. Click Export > Export to Excel.
    4. Open the file in Excel.
    5. Insert a new column and use Code:
    6. =LEN([@[Path]] & "/" & [@[Name]]), This shows the full path length, which is what OneDrive checks.

    7. Sort by length.

    Anything over 200 characters is a risk. Anything over 260 will break OneDrive.

    2. You may use PowerShell with Graph. PnP sometimes fails because it does not return full paths for deeply nested items.