Forum Discussion

amarteens's avatar
amarteens
Copper Contributor
Feb 05, 2025

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 Character limit.  Out of the box they are different and Sharepoint's string limit is considerably higher.  

 

If there was a report, we could get a head of syncing issues. 

1 Reply

  • 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

     

Resources