Inside sharepoint (on-prem & on-line) we can get the total number of items inside a document library (this includes files and folders) from the site content page. but i have a document library with around 28,000 items, and i want to know the following info:-

  1. Total number of files.
  2. Total number of folders/sub-folders
  3. total size.
  4. number of files for certain types (.docx, pdf, etc)..

now i try to run the "Generate file plan report" for the document library, but i got this error The attempted operation is prohibited because it exceeds the list view threshold enforced by the administrator., since my DL contain more than 5,000 items . so can i get the info i need using PnP? Thanks

1 Answer 1


You can loop all items of the library and use IF condition to classify different types files and folders then count them. Powershell script to get count of how many files are in a folder and its subfolders

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.