0

We have a large file server with files and folders that we need to migrate to SharePoint Online. In SharePoint Online, we have a limitation of 400 characters URL limit and a large number of our existing files and folders met this limitation.

To be able to identify them, we need help with a Powershell script that can extract them in a CSV file.

Has anyone done that before or can provide us guidance on how to do it?

After having the CSV file we are planning to have a bot that can rename the files and folders automatically based on the CSV file.

Appreciate your assistance.

2
  • If you will use SharePoint Migration Tool it should be able to do a report before the migration, showing you all those files/folders.
    – Popkornak
    Commented Jun 7 at 12:01
  • Is there any documentation that shows how to fetch such reports since i have been struggling in that one?
    – SmithBZ
    Commented Jun 27 at 12:10

1 Answer 1

1

To find files and folders exceeding the 400 character URL limit for migration to SharePoint Online, you can use PowerShell to generate a CSV file with the file and folder paths. Here's an example script that you can modify to fit your specific needs:

$FolderPath = "C:\Path\To\Your\Folder"

Get-ChildItem -Path $FolderPath -Recurse | Where-Object {$_.FullName.Length -gt 400} | Select-Object FullName | Export-Csv
-Path "C:\Path\To\Your\CSV\File.csv" -NoTypeInformation

This script will search for all files and folders in the specified folder and its subfolders whose path exceeds 400 characters. It will then export the full path of each file and folder to a CSV file that you can use to rename them automatically.

Note that you may need to modify the script to fit your specific environment and requirements.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.