Forum Discussion
Sites with long file path length
At this point, this isn't really a SharePoint problem. It's a file management problem that was carried over from the old file shares. With 60,000+ files affected, nobody is going to fix this manually.
The best approach is to stop creating new long paths by enforcing a naming convention and reducing folder nesting. For the existing content, I'd focus on shortening and reorganizing folders rather than renaming individual files. A single folder rename can reduce the path length for thousands of files underneath it.
PowerShell (PnP PowerShell) can help identify the worst offenders and automate some of the cleanup, but the biggest gains usually come from fixing the folder structure, not the files themselves. If browser access is working well for this department, it may also be worth reconsidering whether OneDrive sync is appropriate for the entire library.
I'd prioritize reporting on:
- Longest folder names
- Deepest folder structures
- Number of files under each folder
Then focus on the top-level folders with the greatest impact. Renaming or restructuring a handful of long, heavily used folders can shorten the paths for thousands of files in one go.
So yes, something can definitely be done, but I'd tackle it strategically rather than trying to fix 61,000 files one by one. That's a governance and cleanup project, not a manual remediation exercise.