Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am trying to retrieve information about site usage via SPSite.UsageInfo programatically or via PowerShell.

Here is simple PowerShell code:

$site = Get-SPSite "http://intranet"
$site.Usage

And it returns something like this:

Storage           : 112959407
Bandwidth         : 0
Visits            : 0
Hits              : 0
DiscussionStorage : 0

The problem is Bandwidth, Visits, Hits and DiscussionStorage properties are always zero. The WebAnalytics is running and it is showing results via Site Usage Reports but these values do not seem to show via API. Is there anything I am missing here.

share|improve this question
add comment

1 Answer

Is it possible information is being omitted by the analysis job?

Ref: SPSite.UsageInfo.Hits

The usage analysis code tracks only data recorded in the HTTP logs. The HTTP logs record most operations except requests for files in the _layouts directory and HTTP requests with results greater than or equal to 300 bytes.

Most SharePoint pages are > 300 bytes, I would believe. If this statement is indeed true, I don't see much use for this metric at all. I don't imagine it would be anything other than 0.

share|improve this answer
    
But Web Analytics would show zeros 0, but there is info about visited pages there... –  Toni Frankola Jul 12 '11 at 20:17
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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