State Service in SharePoint
Every SharePoint person will tell you that it is not a good idea to run the farm configuration wizard when setting up a new farm but rather to create each service application that you need, this ensures that you don’t have any unnecessary resource hogs running. One of the of the core services that gets overlooked is the State Service, people don’t know about it as the farm configuration wizard sets this service up. The odd part is that your farm will function without it, but you will on occasion get the following error message:
“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”.
The are two routes to fix this, the one I consider a no no as it requires you to run the farm configuration wizard, the other is PowerShell (SharePoint 2010 Management Shell).
So how do you do it in PowerShell?
It is pretty straight forward, only three simple steps to get it up and running:
NB: Please ensure you are running PowerShell with an account that has “create database” permissions on your SQL Server instance!!!
Firstly, we must create the service application with the following command:
$serviceApp = New-SPStateServiceApplication -Name "State Service"
Then we must create a database and associate it with the service application we created above:
New-SPStateServiceDatabase -Name "StateServiceDatabase" -ServiceApplication
And lastly, create a proxy for the state service:
New-SPStateServiceApplicationProxy -Name "State Service" -ServiceApplication $serviceApp -DefaultProxyGroup
After this, you need to ensure that your Service Application is associated with your web application.
- Go To Web Application Management in Central Administration.
- Select the Web Application, click on Service Application Associations.
- Ensure that the State Service check box is checked.
A big thank you to Max Berghoff at TopSharePoint for his article on this that pointed me in the right direction, SharePoint 2010 State Service.
Disclaimer:
Please read the disclaimer if you plan on using anything from this article.
Upgrading your SharePoint databases
If you look at the “Review database status” page under “Upgrade and Migration” in SharePoint 2010 Central Administration, you may see a message in the status column that says something like “Database in compatibility range and an upgrade is recommended”. To do this you need to run the PowerShell command “Upgrade-SPContentDatabase but to do this you need to get the identity of each database you want to upgrade and run this command for each one. I have numerous clients that have more than one content db, and you may also want to upgrade the Central Admin databases too, so I have written a PowerShell function that takes in the Web Application and upgrades all databases attached to it:
Function UpgradeDatabases($webApp)
{
$web = Get-SPWebApplication -Identity $webApp
foreach($contentDB in $web.ContentDatabases)
{
Upgrade-SPContentDatabase -id $contentDB
}
}
A pretty straight forward function. Below is the ps1 file.
Download UpgradeDatabases file
Disclaimer:
Please read the disclaimer if you plan on using anything from this article.

