how to count total data in -in the portal different document libraries... RRS feed

  • Question

  • I have different libraries in the portal i want whenever admin wish he should be able to track that this much amount of data has been uploaded up to now

    Let me know how to do

    code help will be appreciated if there is no OOTB way

    sudhanshu sharma Do good and cast it into river :)

    Tuesday, March 19, 2013 11:37 AM


All replies

  • you can use powershell and get the size details

    To display to admin you can create a page where you can call the powershell script

    in the above link and show it your Admin.

    MCTS,MCPD Sharepoint 2010. My Blog-
    If a post answers your question, please click "Mark As Answer" on that post and "Vote as Helpful

    Wednesday, March 20, 2013 12:08 AM
  • In 2007 and 2010, an administrator can run SQL queries against the content database in order to get information about documents and file sizes.  I believe this will still work in 2013, but I've not confirmed this.  This will require SQL knowledge and DBA expertise.

    Here's a useful query to find documents by type and size. You could even write an advanced query to inner join ListId and group by library or folder. That should give you a nice report showing all the details you want.

    SELECT SUM(CAST((CAST(CAST(Size AS DECIMAL(10,2))/1024 AS DECIMAL(10,2))/1024) AS DECIMAL(10,2))) AS ‘Total Size in MB’

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

    INNER JOIN Sites ON Webs.SiteId = Sites.Id

    WHERE Docs.Type <> 1

    AND (LeafName IS NOT NULL)

    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’)

    This query is useful to run against the database to get a more granular list of all the files and their size.  The query can be modified to include specific file types, or all file types.  I'm sure these can get more advanced as you discover all the values available to you in the SQL tables.  

    More queries can be found here.

    I'm obligated to let you know that these queries should be READ-ONLY.  Writing to the content database directly is frowned upon.

    Wednesday, March 20, 2013 3:48 PM
  • Hello Mike,

    this will be very difficult

     cant we do like get all documents library...loop all and get size of each then aggregate in final variable then display to user

    sudhanshu sharma Do good and cast it into river :)

    Friday, March 29, 2013 1:58 PM
  • I'm not sure I understand. It would be more difficult trying to write code that will recursively iterate through all document libraries to get the same information.

    Friday, March 29, 2013 3:03 PM