We are using SP2013 on-premise standard. There are over 50 site collections. By checking each site collection's popularity trend we can see each site collection's click count.

However it is too time consuming to download the reports for over 50 site collection. Is there any existing function or Powershell script can query the summary for entire farm? If not possible, can I query all site collections' figure by PowerShell?


GetRollupAnalyticsItemData method of SearchServiceApplication might help:

$site = Get-SPSite "{SiteUrl}"   
$date = Get-Date "2016-03-07"
$a = (Get-SPEnterpriseSearchServiceApplication).GetRollupAnalyticsItemData(1, [System.Guid]::Empty, $site.ID, [System.Guid]::Empty)

This snippet returns view count (first argument of GetRollupAnalyticsItemData is 1) for one day (GetHitCountForDay). There are other methods and properties available.

Modify it to get whatever data you need and pipe Get-SPSite -limit all to it. GetRollupAnalyticsItemData can also get an argument of GUID type with and ID of particular SPWeb inside SPSite.

Or we can automate analytic reports generation (those excel-files) for each site collection, and then parse them. Good places to start: http://spandps.com/2015/05/30/automating-sharepoint-2013-usage-reports/ and https://blogs.technet.microsoft.com/heyscriptingguy/2015/11/25/introducing-the-powershell-excel-module-2/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.