Add-PnPFile failing with "The attempted operation is prohibited because it exceeds the list view threshold enforced by the administrator" #2242
Unanswered
ajkenfield
asked this question in
General
Replies: 1 comment
-
I am getting the same error in a very similiar situation. I think the problem is that Add-PnPFile is validating that the folder exists, which means it is running a query to check for it. The query is running into the threshold limit. The same error occurs when using Resolve-PnPFile, which would also look for the folder via a query that would get limited. The temporary fix may be to use Add-PnPFolder, which would not use a query. It would likely error if the folder exists so it would have to be trapped for. In addition, Add-PnPFolder adds a folder a time, so building nested folders is more painful. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am getting the following error when using Add-PnPFile:
"The attempted operation is prohibited because it exceeds the list view threshold enforced by the administrator"
I am migrating about 26k documents in to a SPO library and using Add-PnPFile something like this to add the documents and create the destination folder at the same time:
Add-PnPFile -Path $strDocSourceFile -Folder $strDocDestinationFolder -NewFileName $strNewFilename
If I set my $strDocDestinationFolder variable to path like the below I get error:
$strDocDestinationFolder = "MyLibrary/" + $strCaseType + "/" + $strCaseNumber
If I set my $strDocDestinationFolder variable to path like the below I don't get the error:
$strDocDestinationFolder = "MyLibrary/" + $strCaseType
The error seems to be caused when using Add-PnPFile add files into a "Library/Folder/SubFolder" hierarchy and the sub-folder does not exist and not sure if this is by design (or not). Note: this error doesn't kick in until I've migrated something like 20k+ of the documents so it's created a large number of sub-folders by that point (and guessing it's got to 5k sub-folders by this point)
I have managed to work round this issue by using Add-PnPFolder and create the entire folder hierarchy in advance of uploading all the documents, so it's not holding me up, but thought i'd flag it in case it is something that needs to be addressed.
Beta Was this translation helpful? Give feedback.
All reactions