A quick search using just the title of your post produced lots of results. Did you try that before posting here?
https://www.spguides.com/sharepoint-list-view-threshold/
etc.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi, I am trying to create a bulk folder list to a Shared Documents/subfolder1 on Sharepoint Online but i keep getting the threshold error. There were 3790 already there with files inside them and i did attempt to upload 4993 new folders but it started giving the threshold error with 115 folders remaining. What i have tried is a few different scripts and upgrading Powershell to v7 but it fails to create new folders within 1 subfolder of Shared Documents.
Error:
the script i am using is:
#Config Variables
$SiteURL = "https://tenant.sharepoint.com/sites/sitename"
$CSVFilePath = "C:\Script\NewFoldersfile.csv"
$LibraryName = "Shared Documents"
Try {
#Connect to PnP Online
Connect-PnPOnline -Url $SiteURL
$Web = Get-PnPWeb
#Get the Document Library and its site relative URL
$Library = Get-PnPList -Identity $LibraryName #-Includes RootFolder
If($Web.ServerRelativeUrl -eq "/")
{
$LibrarySiteRelativeURL = $Library.RootFolder.ServerRelativeUrl
}
else
{
$LibrarySiteRelativeURL = $Library.RootFolder.ServerRelativeUrl.Replace($Web.ServerRelativeUrl,'')
}
#Get the CSV file
$CSVFile = Import-Csv $CSVFilePath
#Read CSV file and create folders
ForEach($Row in $CSVFile)
{
# This part checks for the folder name and confirm it doesnt have Invalid Characters
$FolderName = $Row.FolderName
# Invalid characters example on $FolderName = [RegEx]::Replace($FolderName, "[{0}]" -f ([RegEx]::Escape([String]'\"*:<>?/\|')), '_')
#Frame the Folder Name
$FolderURL = $LibrarySiteRelativeURL+"/"+$FolderName
#Create Folder if it doesn't exist
Resolve-PnPFolder -SiteRelativePath $FolderURL | Out-Null
Write-host "Folder Created:"$FolderName -f Green
}
}
catch
{
write-host "Error: $($_.Exception.Message)" -foregroundcolor Red
}
A quick search using just the title of your post produced lots of results. Did you try that before posting here?
https://www.spguides.com/sharepoint-list-view-threshold/
etc.
Hi @Imran Shabir,
It's well know SharePoint has a 5000 Document Library limit. So for large number of folders and files upload, I will recommend you to use SharePoint Migration tool.
It accepts a CSV input on a map between folders and different sites/document libraries/subfolders. It will allow you to go back and check for changes after the initial run, and you can keep re-running it.
Here is the document for more details
Overview of the SharePoint Migration Tool (SPMT)
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Hi, would a filter query work on this?