Get detail report of all Documents in SharePoint site using Powershell

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)

The following two tabs change content below.
Adnan Amin
Adnan is an active SharePoint MVP and having over 11 years of extensive experience with major expertise on SharePoint Server, office 365, .Net Platform and Microsoft BI, Adnan is currently working as SharePoint Architect at FMT Consultants. He is MCT Regional Lead for Pakistan Chapter since 2012. He is working on SharePoint for past seven years and worked on different intranet/intranet solutions for private & govt. sector majorly in United States and Gulf region, which include OOB and customized solutions. He is a trainer, technology evangelist and also speaks in community forums.

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *