Alexander's Blog

Sharing knowledge with the global IT community since November 1, 2004

Configuring the State Service in SharePoint 2010

/
/
ad-mania

In SharePoint Server 2010, the State Service is a shared service that is used by some components to store temporary data across related HTTP requests in a SQL Server database. The State Service is required by InfoPath Forms Services (including out of the box and custom workflow forms), the SharePoint Server 2010 Chart Web Part, and certain Microsoft Visio 2010 scenarios that do not use Microsoft Silverlight 3.

Problem

After you install SharePoint Server 2010 you may see the following warning in the Health Analyzer Reports.

InfoPath Forms Services forms cannot be filled out in a Web browser because no State Service connection is configured.

If you have configured a workflow form, you may see the following error.

The form cannot be rendered. This may be due to a misconfiguration of the Microsoft SharePoint Server State Service. For more information, contact your server administrator.


Solution

Configure the State Service. The State Service is automatically configured as part of the Basic installation of SharePoint Server 2010. However, the Advanced installation of SharePoint Server 2010 requires separate configuration of the State Service. You can use one of the following two methods to configure the service.

  1. Farm Configuration Wizard (I don’t recommend using this wizard after installing SharePoint).
  2. PowerShell (this is my preferred method).

The default configuration for the State Service is sufficient for most configurations and you only need additional configuration if your server farm has a very large number of InfoPath active state sessions for forms or charts, or you may need additional configuration in hosted environments.

The default configuration includes the following.

  • One State Service service application.
  • One State Service database on the same database server that contains the configuration database. The databases must be associated with the service application.
  • One State Service application proxy associated with the default proxy group of the server farm.

As I mentioned earlier, I prefer using the PowerShell to configure the State Service. By the way, you can also use PowerShell to perform configuration tasks that are not available on the Central Administration site of the farm.

Use PowerShell to Configure the State Service

Here are the steps to configure the service using PowerShell.

  1. Verify that you meet the minimum requirements. See Add-SPShellAdmin for more details. Essentially, you need to add the logged in user account to the SharePoint_Shell_Access role in the target database using the following syntax.
    Add-SPShellAdmin [-UserName]
    If you are already logged in as a user that has the securityadmin and dbowner role in SQL Server and is a member of the WSS_Admin_WPG user group then you can skip this step.
  2. On the Start menu, click All Programs.
  3. Click Microsoft SharePoint 2010 Products.
  4. Click SharePoint 2010 Management Shell.
  5. To create a service application, type the following command:
    $serviceApp = New-SPStateServiceApplication -Name “<StateServiceName>
    For example, $serviceApp = New-SPStateServiceApplication -Name “Intranet Farm State Service
  6. After the service application is created, you need to create a State Service database and associate it with a service application.
    New-SPStateServiceDatabase -Name “ <StateServiceDatabase>” -ServiceApplication $serviceApp
    For example, New-SPStateServiceDatabase -Name “StateServiceDB” -ServiceApplication $serviceApp
  7. To create a State Service application proxy, associate it with the service application, add it to the farm’s default proxy group, type the following command.
    New-SPStateServiceApplicationProxy -Name “<ApplicationProxyName>” -ServiceApplication $serviceApp -DefaultProxyGroup
    For example, New-SPStateServiceApplicationProxy -Name “Intranet Application Proxy” -ServiceApplication $serviceApp -DefaultProxyGroup
  8. Here’s what the summary of the commands might look like. The commands in the red are the one you would type, the output is shown in blue.
  9. As soon as you run the above command to finish configuring the State Service, re-analyze the rule (listed in the problem section above) in the Health Analyzer Reports.
  10. Click the rule and then click Reanalyze Now.
  11. Refresh the screen. The warning message should disappear in the Health Analyzer Reports.

More information on this topic is available on Microsoft TechNet here.


Copyright ©2010 Zubair Alexander. All rights reserved.

  • Facebook
  • Twitter
  • Linkedin

3 Comments

  1. This was VERY helpful during my upgrade from 2007 to 2010 – thank you so much for the commandlets.

  2. Please help me, every time when I try I get the error:

    The term ‘New-SPStateServiceApplicationProxy’ is not recognized as the name of
    a cmdlet, function, script file, or operable program. Check the spelling of the
    name, or if a path was included, verify that the path is correct and try again
    .
    At line:1 char:35
    + New-SPStateServiceApplicationProxy <<<< -Name "Intranet Application Proxy" –
    ServiceApplication $serviceApp -DefaultProxyGroup
    + CategoryInfo : ObjectNotFound: (New-SPStateServiceApplicationPr
    oxy:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Leave a Comment

Your email address will not be published. Required fields are marked *

This div height required for enabling the sticky sidebar