Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Get total count of documents for the entire SharePoint farm

$
0
0

I need to know the total number of documents in our SharePoint On-Premise environment. We have SharePoint 2016 and 2013.

I found this script and tried executing it on my content databases:

SELECT COUNT(*)

FROM Docs INNER JOIN Webs On Docs.WebId = Webs.Id

INNER JOIN Sites ON Webs.SiteId = SItes.Id

WHERE

Docs.Type <> 1 AND (LeafName NOT LIKE '%.stp')  

               AND (LeafName NOT LIKE '%.aspx'

               AND (LeafName NOT LIKE '%.xfp'

               AND (LeafName NOT LIKE '%.dwp'

               AND (LeafName NOT LIKE '%template%'

               AND (LeafName NOT LIKE '%.inf'

               AND (LeafName NOT LIKE '%.css')

However, the number  count that I get seem bigger than I expect. I try to compare it with the Search Crawl logs and there's a big difference.

Will it be okay to use the search crawl log for determining the number of documents in the farm? I just need a rough estimate. If you have a PowerShell script that you can recommend then please let me know.


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>