Monday, April 4, 2011

Configuration of the Microsoft SharePoint Server State Service using PowerShell

If you are trying to develop new InfoPath 2010 form and after deployment you are receiving the following errors:

"SharePoint 2010 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."

"InfoPath Forms Services not working due to invalid State Service configuration - Event 7898"


Then you need to configure the State Service. There are 2 options:

Option 1: Using PowerShell command
Open SharePoint Management Shell and type the following commands:

$serviceApp = New-SPStateServiceApplication -Name "State Service"

New-SPStateServiceDatabase -Name "StateServiceDatabase" -ServiceApplication $serviceApp

New-SPStateServiceApplicationProxy -Name "State Service" -ServiceApplication $serviceApp -DefaultProxyGroup

Option 2: Using "Farm Configuration Wizard" (however this approach is highly NOT recommended...) 
  • launch the "Farm Configuration Wizard" from Central Admin
  • click Start the Wizard 
  • select the State Service check box and click "Next"
  • click Finish

 One note here: if the State Service is greyed out, this means that it is already configured and the only way to change it is using PowerShell commands. Once configured it can not be retracted using Farm Configuration Wizard


1 comment:

Vu 886 said...

Save me a lot of time