I have upload a Powershell script in Technet Gallery which will be very useful to get detail reports of all documents in a SharePoint Site Collection or site and sub sites. This script will list all document libraries which also system libraries (i.e. Master Page Gallery, List Template Gallery, etc.) and will list all documents in them.We have tested it on both SharePoint 2013 and SharePoint 2010 servers. (Click here to download the script file)

It contains a Function named Get-DocInventory which take single parameter i.e Site URL

Get-DocInventory "http://sp2013"

It will list the following properties of a document

  • Site URL
  • Web URL
  • Library Name
  • ID
  • Title
  • File URL
  • File Size
  • File Size (MB)
  • Modified Date
  • Modified By
  • Created Date
  • Created By

Check below image which show the detail report.

Get detail report of all Documents in SharePoint site using PowerShell
Get detail report of all Documents in SharePoint site using PowerShell

You can easily sort data by library name, title or by size.

There are two ways two execute this script, you can open script out put in grid view or can also export output in CSV format.

Run below command to get output in grid view:

Get-DocInventory "http://sp2013" | Out-GridView

Run below command to export output in CSV file:

      Get-DocInventory "http://sp2013" | Export-Csv -NoTypeInformation -Path c:\csv\Documents_Detail_Report.csv

(Click here to download the script file)

Adnan, a distinguished professional, boasts an impressive track record as a Microsoft MVP, having achieved this prestigious recognition for the eighth consecutive year since 2015. With an extensive career spanning over 18 years, Adnan has honed his expertise in various domains, notably excelling in SharePoint, Microsoft 365, Microsoft Teams, the .Net Platform, and Microsoft BI. Presently, he holds the esteemed position of Senior Microsoft Consultant at Olive + Goose. Notably, Adnan served as the MCT Regional Lead for the Pakistan Chapter from 2012 to 2017, showcasing his leadership and commitment to fostering growth within the tech community. His journey in the realm of SharePoint spans 14 years, during which he has undertaken diverse projects involving both intranet and internet solutions for both private and government sectors. His impact has transcended geographical boundaries, leaving a mark on projects in the United States and the Gulf region, often collaborating with Fortune 500 companies. Beyond his roles, Adnan is a dedicated educator, sharing his insights and knowledge as a trainer. He also passionately advocates for technology, frequently engaging with the community through speaking engagements in various forums. His multifaceted contributions exemplify his dedication to the tech field and his role in driving its evolution.

Leave a Reply

2 replies on “Get detail report of all Documents in SharePoint site using Powershell”

  • R S
    March 13, 2023 at 3:24 pm

    Hi Adnan,
    I was looking of a way to report on site content in SharePoint 2010 and came to this post. Seems exactly what I need – thank you for sharing that.
    Unfortunately the link to the script above brings MS Technet (now MS Learn) galley, but not your script… 🙁
    Do you have the script published somewhere else or any chance to email it to me, please?
    Thank you in advance.
    Best,
    RS