Forum Discussion
amarteens
Feb 05, 2025Copper Contributor
File string limit check
Is there a report that can be run on Sharepoint to show file string size sorted highest to lowest? The issue we are running into is the difference between Sharepoint character limit and Windows Char...
Kidd_Ip
Oct 13, 2025MVP
How about using a script:
- Connects to your SharePoint Online site
- Recursively scans document libraries
- Calculates the full path length of each file
- Outputs a report sorted by path length
Connect-PnPOnline -Url "https://yourtenant.sharepoint.com/sites/yoursite" -Interactive
$files = Get-PnPListItem -List "Documents" -PageSize 5000 -Fields "FileRef"
$report = $files | Select-Object @{Name="Path";Expression={$_.FieldValues.FileRef}}, @{Name="Length";Expression={$_.FieldValues.FileRef.Length}} | Sort-Object Length -Descending
$report | Export-Csv -Path "LongPathsReport.csv" -NoTypeInformation