I'm dealing with a bit of a nightmare scenario here. I've inherited a OneDrive situation where there are file paths longer than 255 characters—some are pushing 400! I can't sync with a local drive to look for them, so I'm trying to figure out how to check this directly in the cloud. Is there any script or tool out there that can help me connect to OneDrive and identify these long paths? I've tried using ChatGPT, but after several hours of frustration trying to set up certificates and secret keys, I'm at my wit's end. If anyone has successfully tackled this problem, I'd really appreciate your help!
5 Answers
This command might be helpful for local checks: Get-ChildItem -Recurse | Where-Object { $_.FullName.Length -gt 254 }. But keep in mind, it won't work for the cloud directly.
Even though this is a Powershell-focused question, you might find the SharePoint Migration Tool really useful. It generates analysis reports on path lengths exceeding 255 characters and is pretty user-friendly.
Thanks for the links! They look super useful.
I appreciate the suggestions! Really helps me out.
You might want to try using ShareGate, too. It’s simple for non-techies to use, which could save you from having to teach someone how to run scripts as updates occur.
I’m open to any solution, so thank you for the suggestion!
You should consider using PnP PowerShell to check for documents in your OneDrive or SharePoint site. Another option is to enable the long path fix, as it can extend limits beyond what SharePoint/OneDrive generally enforce. This could help resolve your issue!
That's a handy tip! But keep in mind that the long path fix only addresses local path limitations on Windows. It won't necessarily help with syncing issues on OneDrive itself.
I’ve run into sync issues as well, especially with Macs involved. Long paths can crash OneDrive, which complicates things further.
Is this issue related to OneDrive or SharePoint? If it’s SharePoint, my advice would be to stop syncing locally since it just eats up time. I might have an old script that could help you out; let me know if you're interested!
It's actually for OneDrive.
Just remember, it’s all tied into SharePoint, but they handle things a bit differently.
Good point! I'd like to check online since the app crashes on both Windows and Macs.