Configuring the State Service in SharePoint 2010
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.
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.
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.
- Farm Configuration Wizard (I don’t recommend using this wizard after installing SharePoint).
- 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.
- 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.
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.
- On the Start menu, click All Programs.
- Click Microsoft SharePoint 2010 Products.
- Click SharePoint 2010 Management Shell.
- To create a service application, type the following command:
$serviceApp = New-SPStateServiceApplication -Name “<StateServiceName>“
For example, $serviceApp = New-SPStateServiceApplication -Name “Intranet Farm State Service“
- 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
- 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
- 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.
- 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.
- Click the rule and then click Reanalyze Now.
- 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.