Forum Discussion
aasenomad
Feb 22, 2022Copper Contributor
How to delete large OneDrive folder and nested subfolders
A particular user have a very large OneDrive folder with nested subfolders so I'm just wondering how can I modify my current script so that it'll be able to delete large folder with so many nested fo...
aasenomad
Feb 26, 2022Copper Contributor
Hi..I'm deleting it from OneDrive folder that has like over 4million item and about 900GB. and this are the error that I get when a subfolder has a lot and lots of items inside. Also there are too many nested subfolder so I can't really count.
```
Error: Microsoft.SharePoint.Client.Folder.UniqueId - Microsoft.SharePoint.Client.File.Name Exception calling "ExecuteQuery" with "0" argument(s): "The operation has timed out."
Error: Microsoft.SharePoint.Client.Folder.UniqueId - .Name Exception calling "ExecuteQuery" with "0" argument(s): "The attempted operation is prohibited because it exceeds the list view threshold."
```
```
Error: Microsoft.SharePoint.Client.Folder.UniqueId - Microsoft.SharePoint.Client.File.Name Exception calling "ExecuteQuery" with "0" argument(s): "The operation has timed out."
Error: Microsoft.SharePoint.Client.Folder.UniqueId - .Name Exception calling "ExecuteQuery" with "0" argument(s): "The attempted operation is prohibited because it exceeds the list view threshold."
```
farismalaeb
Feb 27, 2022Iron Contributor
This is a lot of data and requests sent in one patch to the server, and I don't think the servers will be happy to serve your request.
I guess the failure is on the delete part Empty-SPOFolder, not on reading the content.
I guess I read a similar threat a long time ago, and the answer was to use the latest version of the SharePoint management shell.