Getting started

Install SharePoint - Configure Web Analytics service application using PowerShell

After I installed SharePoint I tried to create a SharePoint 2010 Web Analytics service application using PowerShell which ended with the following error message: "Start-SPServiceInstance : Cannot validate argument on parameter 'Identity'. The argument is null. Supply a non-null argument and try the command again."

This was really interesting since I re-used a script provided by Microsoft TechNet.

Background

The SharePoint 2010 Web Analytics Service Application allows you to analyze how people use your SharePoint sites by collecting data and creating reports based on it. You can create the Service Application either with the Farm Configuration Wizard (after creating Central Administration), manually using the Central Administration UI or by PowerShell.

It requires a Web Analytics Reporting database and one Web Analytics Staging database.

Error description

The error message is pretty detailed since it gives a line...

Start-SPServiceInstance : Cannot validate argument on parameter 'Identity'. The argument is null. Supply a non-null argument and try the command again. 
At C:\Users\spadmin\Desktop\6_Service Applications_Services\SharePoint Server 2010 Sta\Service Application - Web Analytics.ps1:67 char:32
+ Start-SPServiceInstance <<<<  $AnalyticsServiceInstance
+ CategoryInfo: InvalidData: (:) [Start-SPServiceInstance], ParameterBindingValidationException 
+ FullyQualifiedErrorId: ParameterArgumentValidationError,Microsoft.SharePoint.PowerShell.SPCmdletStartServiceInstance

But at the end it took me some time to find the error…

Here is the corresponding screenshot:

image

Solution

In line 3 the last curly bracket is missing… I thought about many different things before I noticed the missing bracket.

#Start Analytics service instances 
write-host "Starting Analytics Service instances ..."
$AnalyticsDataProcessingInstance = Get-SPServiceInstance | where-object {$_.Name -eq "WebAnalyticsServiceInstance"} | where-object {$_.Server.Address -eq $CentralAdminServer
$AnalyticsWebServiceInstance = Get-SPServiceInstance | where-object {$_.TypeName -eq "Web Analytics Web Service"} | where-object {$_.Server.Address -eq $CentralAdminServer}

image

Anyway at the end I was successful deploying the SharePoint 2010 Web Analytics service application and I was able to continue to install SharePoint.

blog comments powered by Disqus