Get detail report of all Documents in SharePoint site using Powershell

Attached powerShell script is 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.).

4.7 Star
24,222 times
Add to favorites
E-mail Twitter Digg Facebook
  • Work on Document Libraries AND Lists ????
    2 Posts | Last post July 25, 2019
    • I saw the earlier question if this PowerShell script works on both document libraries AND lists.  
      But I did not see an answer.  
      Does it also work on lists?  If not, how can I modify it to ALSO work on lists?  I want to get a complete site inventory if possible.
    • Sorry for late reply, this script only work for document libraries. If you need to get details for list attachments then it will require modifications as you need to list items and then attachments object (collection) for each list item and iterate through the attachment object to get details for each attachment.
  • Using this with SharePoint Online
    2 Posts | Last post September 07, 2017
    • Hi, I am trying to use this with SharePoint Online and I cannot get it to work.  It keeps giving me Get-PnPSite : A positional parameter cannot be found that accepts argument '<sharepoint site>'.  Any idea how to run this against a SharePoint Online site?
    • Hi,
      This script is for SharePoint on-premise and it will not work on SharePoint online because PowerShell cmdlets for SharePoint online are different. I will work on that and will share it soon.
  • Execute
    1 Posts | Last post January 15, 2016
    • I am trying to run the script as
      PS C:\backups> .\Generate.ps1 "http://sharetctbr" | Out-GridView
      Then appears a new window but only shows: 
      the list of the 4 dlls invoked
  • I have tried running the query but getting below error
    1 Posts | Last post October 30, 2015
    • Get-DocInventory : Exception has been thrown by the target of an invocation.
      At D:\Generate Document Info Report.ps1:37 char:17
      + Get-DocInventory <<<<  "http://sites/subsite" | Export-Csv -No
      TypeInformation -Path "c:\Document_Detail_Report.csv"
          + CategoryInfo          : NotSpecified: (:) [Get-DocInventory], TargetInvo
          + FullyQualifiedErrorId : System.Reflection.TargetInvocationException,Get-
  • List and Libraries
    1 Posts | Last post October 15, 2015
    • I think I seen one of your answers and you stated this iterates through list and libraries. Just to clarify are you saying that this script outputs files/items from document libraries and list? Please advise.
  • Versions sizes
    1 Posts | Last post May 29, 2015
    • Hi, Is there any way to get versions sizes also with this script?
  • Custom Item Columns
    1 Posts | Last post May 17, 2015
    • Hi Amin
      How do i add a custom column to the script so that i get extra columns in the output?
    2 Posts | Last post April 13, 2015
    • We are suppose to use STSADM rather than PowerShell on MOSS 2007 n
    • I haven't tested it with STSADM, I have tested it on SP 2010 and 2013 environments..
  • Run against subsite and specific directory
    2 Posts | Last post April 13, 2015
    • I am trying to run this against a subsite ( but it is returning everything for the whole web app instead.  More specifically I'd like to be able to report on a certain level in the structure something like:
      any feedback?
    • If you go through the details in script, it is looping through all sites and then list & libraries and then folders from each site for a web application. You can modify the script for your requirement.
      This script is using the site and its list & libraries.
  • Does it support on sharepoint 2007
    3 Posts | Last post March 11, 2015
    • Does it support on sharepoint 2007???If not any other shell script can do that ??? 
      Thanks  a lot 
    • This script only supports SharePoint 2010 and SharePoint 2013. 
    • Okay