Hi all,<\/p>\n
I am trying to find a way to identify all of the files in Sharepoint online in which the file paths are too long. I have looked at a few Powershell & PNP scripts that have been used for this but I have been unable to get them to work. Most of the scripts don’t seem to be just plug and play and I am not very familiar with Powershell OR PNP.<\/p>\n
I am seeking some assistance from the community on the best & easiest way to gather this information.<\/p>","upvoteCount":4,"answerCount":3,"datePublished":"2025-03-05T22:16:18.253Z","author":{"@type":"Person","name":"FrenchToast","url":"https://community.spiceworks.com/u/FrenchToast"},"suggestedAnswer":[{"@type":"Answer","text":"
Hi all,<\/p>\n
I am trying to find a way to identify all of the files in Sharepoint online in which the file paths are too long. I have looked at a few Powershell & PNP scripts that have been used for this but I have been unable to get them to work. Most of the scripts don’t seem to be just plug and play and I am not very familiar with Powershell OR PNP.<\/p>\n
I am seeking some assistance from the community on the best & easiest way to gather this information.<\/p>","upvoteCount":4,"datePublished":"2025-03-05T22:16:18.324Z","url":"https://community.spiceworks.com/t/how-to-identify-long-file-paths-in-sharepoint-online/1182547/1","author":{"@type":"Person","name":"FrenchToast","url":"https://community.spiceworks.com/u/FrenchToast"}},{"@type":"Answer","text":"
It is more complicated than it appears, the 400 char limit applies to ANY URI you might form that accesses a file in SharePoint, so it also includes the http://sitename/<\/a> etc part SharePoint Online has a strict 400-character URL limit — including the site URL, folders, and file name. Files exceeding that often fail to sync, upload, or move properly.<\/p>\n Quick ways to identify issues:<\/strong><\/p>\n
\nThere is a second limit of 255 chars on any filename itself, and on any folder name within the path/URI.<\/p>","upvoteCount":2,"datePublished":"2025-03-05T22:54:07.479Z","url":"https://community.spiceworks.com/t/how-to-identify-long-file-paths-in-sharepoint-online/1182547/2","author":{"@type":"Person","name":"somedude2","url":"https://community.spiceworks.com/u/somedude2"}},{"@type":"Answer","text":"\n
\nUse Get-ChildItem with FullName.Length to scan local or synced directories before upload. Script it to flag anything over ~250–260 chars.<\/li>\n