SharePoint Site Collection Document Library report - PNP Powershell

Sam Blowers 0 Reputation points
2025-08-06T20:50:34.5966667+00:00

I have been asked to get a report on all document libraries and their data within a SharePoint site collection.

I am looking for a PNP Powershell script that can be run on a single SharePoint Online site collection and give me the following columns:

  • Document Library Name
  • Document Library URL
  • Total number of Files/Folders/Sub-Folders in library
  • Name of Folders/Sub-Folders
  • Number of Folders/Sub-Folders in Library
  • Number of Files in each Folder/sub-Folder (even if 0)
  • Size of Library
  • Created By/Modified By
  • Created/Modified Date and Time
Microsoft 365 and Office | SharePoint | Other | Other
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Hani-N 1,460 Reputation points Microsoft External Staff Moderator
    2025-08-06T22:32:54.1266667+00:00

    Hi @Sam Blowers

    Thank you for reaching out to the Microsoft Q&A forum and for providing detailed information about your request. 

    It appears you're looking for a PnP PowerShell script to generate a comprehensive report on all document libraries within a SharePoint Online site collection. This includes advanced details such as folder-level file counts and audit metadata. While we’re glad to offer general guidance, the level of complexity involved in your scenario, especially around deep analysis of SharePoint structures and customized reporting, goes beyond the scope of what we can fully support here in the forum. 

    As moderators of the Microsoft Q&A forum, our primary role is to assist with: 

    • General usage of PnP PowerShell and SharePoint Online features 
    • Clarifying official documentation and command syntax 
    • Providing examples for common tasks and troubleshooting basic issues 

    Therefore, for more advanced needs such as environment-specific scripting, performance optimization, or detailed metadata extraction, I recommend creating a support ticket with Microsoft to working directly with our Microsoft SharePoint support engineers. These experts have access to diagnostic tools and deeper insights into your tenant configuration, allowing them to provide tailored solutions that align with your organization’s requirements. 

    We understand that every SharePoint environment is unique and ensuring your reporting needs are met accurately and efficiently is important. That’s why engaging with our dedicated support team is the best path forward for scenarios that require deeper technical involvement. 

    To request personalized assistance, please follow these steps to create a support ticket: 

    1. Go to the Microsoft 365 Admin Center 
    2. Sign in using your administrator account 
    3. Navigate to Help & Support 
    4. Enter a detailed description of your request (e.g., assistance with SharePoint site provisioning, Planner integration, or advanced reporting using PnP PowerShell) 
    5. Select Contact support to submit your ticket 

    Once your ticket is submitted, feel free to share the case number here. I’ll be happy to follow up or help coordinate with the support team to ensure your request is addressed promptly. 

    We truly appreciate your engagement in the forum and look forward to helping you with any general guidance you may need. For deeper technical scenarios, our support engineers are well-equipped to assist you further. 

     

    Thank you again for your understanding and cooperation. I appreciate your time and initiative in following these steps, and I’m here if you need further guidance. 

    Wishing you a great day ahead. 

     


    As other users will also search information in this community, kindly mark it as an answer, your valuable vote will definitely also help other users who have similar queries easily to find the correct channel and useful information more quickly.    

    I appreciate your kind words.  User's image

    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. 

    0 comments No comments

  2. Hani-N 1,460 Reputation points Microsoft External Staff Moderator
    2025-08-08T21:07:52.4333333+00:00

    Hi @Sam Blowers,  

    I hope you're having a pleasant week so far. 

    Following up on the support thread we've been working on. I hope the information I shared in my previous answer was clear and helpful. If you are still facing the same issue or need assistance with anything else, kindly respond to this email, and I will be happy to help. 

    We want to make sure everything is working as expected and that your experience remains uninterrupted. 

    Thank you for your patience and understanding throughout the troubleshooting process.  

    I look forward to hearing from you soon.  

     


    As other users will also search information in this community, kindly mark it as an answer, your valuable vote will definitely also help other users who have similar queries easily to find the correct channel and useful information more quickly.   

    I appreciate your kind words.  

    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. 

    0 comments No comments

  3. Hani-N 1,460 Reputation points Microsoft External Staff Moderator
    2025-08-11T22:40:15.78+00:00

    Good day @Sam Blowers,  

    I hope you are having a great day 

    I'm reaching out again to follow up on your issue and check if everything has been resolved. My goal is to ensure your experience remains smooth and hassle-free. If you're still encountering any problems or have run into new challenges, please let me know which steps you're currently stuck on and happy to provide further help whenever you need it.  

    If you have any further questions, feel free to tag me in your reply so I can assist you directly. 

    Looking forward to your update. 


     As other users will also search information in this community, kindly mark it as an answer, your valuable vote will definitely also help other users who have similar queries easily to find the correct channel and useful information more quickly.    

    I appreciate your kind words.   

    Have a nice day and stay healthy   

    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.  

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.