none
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

Answers

All replies

  • you can use powershell and get the size details

    http://get-spscripts.com/2010/08/check-size-of-sharepoint-2010-sites.html

    To display to admin you can create a page where you can call the powershell script  http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/faa70c95-6191-4f64-bb5a-5b67b8453237/

    in the above link and show it your Admin.


    MCTS,MCPD Sharepoint 2010. My Blog- http://www.sharepoint-journey.com
    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
    Moderator
  • 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.


    http://donahoo-development.com

    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.


    http://donahoo-development.com

    Friday, March 29, 2013 3:03 PM