SharePoint 2010–Using Web Analytics

When you want to run a Web Analytics report you may receive the following error:

There is no data available for this report. Here are some possible reasons: (1) Web Analytics has not been enabled long enough to generate data; (2) There is insufficient data to generate this report; (3) Data logging required for this report might not be enabled; (4) Data aggregation might not be enabled at the level required for this report.

In order to view a report you will have to install the Web Analytics Service Application. The next steps will describe how to install the Web Analytics Service Application in a multiple server farm. The Web Analytics Service Application will be installed on the backend farm.

Provision the Web Analytics Services

  1. Go to the Central Administration –> Application Management –> Manage Service Applications
  2. Click within the Ribbon on New –> Web Analytics Service Application
  3. Provide a name for the Service Application and create a new app pool or use an existing (I recommend to use one application pool for several Service Applications)
  4. Provide a unique name for the Web Analytics, Staging and Reporting Database
  5. After you have created the Service Application you will have to start two services for populating the data. Go to Central Administration –> System Settings -> Manage service on server. Start the following two services:
    1. Web Analytics Data Processing Service
    2. Web Analytics Web Service

image

Choose which events you want to log

  1. Once the services are started go to Central Administration –> Monitoring –> Configure Web Analytics and Health Data Collection and set the appropriate logging, you’ll want to make sure you’re logging following:

    1. Page Requests

    2. Search Query Usage

image


Associate the Service Application with the Web App

  1. You also want to make sure that your Service Application is associated with your Web Application, so go to Central Admin –> Manage Web applications
  2. Highlight the web application you want and click “Service Connections” in the ribbon bar.
  3. Make sure the Web Analytics Service Application is associated with the web app

image

It is recommended when using a multiple server farm to start these service on multiple servers.

After you have performed these steps you can use the Web Analytics reporting. It can take one day before you can view any results. This because the data has to be populated.

SharePoint 2010–Powershell to dump out the Site Collection Storage Usage for a Farm

Recently I was working for a company with a lot of site collections and they wanted to look at some of the usage stats and other relevant information about how the site collections are being utilized on the farm.  This is actually very easy to do utilizing PowerShell because we can “Get-SPSiteAdministration” and then write out the information in a nice table format.

First step is to get the SPSiteAdministration into an object variable that we can run get-members on so we know what is exposed to us for reporting purposes (Note: Use Get-SPSiteAdministration instead of Get-SPSite because we want to report on stuff in the farm that we may not be site collection admins of like mySites)

$sc = Get-SPSiteAdministration –Identity http://SiteCollection

$sc | Get-Member

You’ll get a nice output like the following, I’ve highlighted what we are interested in:

TypeName: Microsoft.SharePoint.Administration.SPSiteAdministration

Name                      MemberType Definition

—-                      ———- ———-

AddWeb                    Method     System.Void AddWeb(string strWebUrl, string strTitle, string strDescription, Sy…

ApplyWebTemplate          Method     System.Void ApplyWebTemplate(string strWebTemplate)

Delete                    Method     System.Void Delete(), System.Void Delete(bool bDeleteADAccounts), System.Void D…

Dispose                   Method     System.Void Dispose()

Equals                    Method     bool Equals(System.Object obj)

GetHashCode               Method     int GetHashCode()

GetType                   Method     type GetType()

ToString                  Method     string ToString()

AdministrationSiteType    Property   Microsoft.SharePoint.SPAdministrationSiteType AdministrationSiteType {get;set;}

AverageResourceUsage      Property   System.Double AverageResourceUsage {get;}

CurrentResourceUsage      Property   System.Double CurrentResourceUsage {get;}

Description               Property   System.String Description {get;}

DiskUsed                  Property   System.Int64 DiskUsed {get;}

LockIssue                 Property   System.String LockIssue {get;set;}

OwnerEmail                Property   System.String OwnerEmail {get;}

OwnerLoginName            Property   System.String OwnerLoginName {get;set;}

Quota                     Property   Microsoft.SharePoint.Administration.SPQuota Quota {get;set;}

ReadLocked                Property   System.Boolean ReadLocked {get;set;}

ReadOnly                  Property   System.Boolean ReadOnly {get;set;}

RootWebProvisioned        Property   System.Boolean RootWebProvisioned {get;}

RootWebTemplate           Property   System.String RootWebTemplate {get;}

SecondaryContactLoginName Property   System.String SecondaryContactLoginName {get;set;}

SiteSubscription          Property   Microsoft.SharePoint.SPSiteSubscription SiteSubscription {get;}

Title                     Property   System.String Title {get;}

Url                       Property   System.String Url {get;}

UsersCount                Property   System.Int32 UsersCount {get;}

WriteLocked               Property   System.Boolean WriteLocked {get;set;}

 

From here it’s just a matter of putting together a PowerShell Script that will grab all the site collections in the farm

Get-SPSiteAdministration

piped into a selection so we can print out the amount of disk used and users:

Get-SPSiteAdministration | select Url, DiskUsed, UsersCount

if you’re dealing with a large amount of SiteCollections here is where you tack on the –Limit All to the Get-SPSiteAdministration and of course you’ll want to add some table formatting, and I’m assuming if you’re looking at this information what you really care about are the biggest sites:

Get-SPSiteAdministration -Limit All | select Url, DiskUsed, UsersCount | Sort-Object -Descending -Property "DiskUsed" | Format-Table –AutoSize

Of course, you’ll probably want to include the amount of DiskUsed in Megabytes

Get-SPSiteAdministration -Limit All | select Url, @{label = "Size";Ex = {$_.DiskUsed/1MB}}, UsersCount | Sort-Object -Descending -Property "Size" | Format-Table –AutoSize

Or write it out to an .html file for nicely formated web viewing:

Get-SPSiteAdministration -Limit All | select Url, @{label = "Size";Ex = {$_.DiskUsed/1MB}}, UsersCount | Sort-Object -Descending -Property "Size" | ConvertTo-Html -title "Site Collections" | Set-Content sc.html

And there you have it, a nice way for a farm admin to report on all the disk usage and user information lists in their farm

InfoPath Cannot Open The Following Form…

If you receive:

InfoPath cannot open the following form: <url>
The file is not a valid XML document.
DTD is prohibited.

This problem occurs when the form template that was used to create the form is not available or cannot be downloaded from the site.  The form template was not sent in the e-mail message, or the form template was not published to a shared location.

The resolution is to add the URL for the form template to your trusted sites or local zone and ensure that the person has ‘Contribute’, the minimum permissions required to update InfoPath forms.

SharePoint 2010: Exposing the User Information List

There are times when working with SharePoint that we want to make use of the User Information List beyond what SharePoint has been designed for.  However, when trying to work with the list in SharePoint Designer 2010 when trying to access the list we get the msCryptic that:

SharePoint designer cannot display the content of this view

Yet, I am able to bring up the list in a browser without issue.  This is due to the fact that in SharePoint 2010, the list is not editable and we cannot add anything to the User Information List.  In order to “fix” this issue (and I won’t go into the security issues of doing this at this time) we can rely on our trusty PowerShell bag of tricks.

In order to unhide the list so it’s usable within the UI, try running this PowerShell script:

$WebUrl = "http://sharepoint"
$ListName = "User Information List"
$OpenWeb = Get-SPWeb $WebUrl
$List = $OpenWeb.Lists[$ListName]
$List.Hidden = $false
$List.Update()

After running this, you are now able to add columns to the User Information List and create lookup columns from the data.

Barbeque Cooking Tips

Once again we’re gearing up for Sumer, and that means it is Barbeque season. Basically barbeque is special technique that is used to add great taste to beef, pork, chicken, or even vegetables.  Cooking barbeque style means cooking on low heat or using the smoke from chunks of wood that gives the food a great flavor.  Barbeque cooking is not very hard to do, you just need to follow a couples instructions and tips for perfect Barbeque. 

Some people have very particular methods or myths (See MythBusting Backyard Barbeque Myths for some of these ).

I’ve always been a great fan of Tri-Tip, here’s one of my favorite recipes: Barbeque: Santa Maria Smoked Tri-Tip

However, if you’re looking for some good tips to make your Barbeque experience fun, healthy and tasty, here’s a few things to remember this summer:

General tips regarding barbeque:

  • Barbeque should be cooked on slow heat, this is what helps break down to collagen.
  • Make sure that grill that you will use is clean.
  • When using a coal barbeque, the coals are ready when surface of coals are grey and all the flames are gone.
  • Keep a spray water bottle near you as you can use it in case of flare-ups.
  • Plan your barbeque cooking, keep everything on hand for frequently uses.
  • If you marinate, do so for 30 minutes right before you put it on the grill.
  • A good basting brush makes for awesome barbeque cooking.

If you follow these tips, you will be a Barbeque god this Summer and enjoy the thrill of the grill.