This article will show you how you can re-create the “SharePoint Server ASP.NET Session State Service”, “State Service” and “State Service Proxy” for a default and non customized Sharepoint 2013 environment.
In the Central Admin->Manage Service Applications these services show up as follows:
Get-SPSessionStateService -> shows as type “SharePoint Server ASP.NET Session State Service”
Get-SPStateServiceApplication-> shows as type “State Service” with “State Service Proxy”
1.) At first check for the ID from the old “SharePoint Server ASP.NET Session State Service” and “State Service” via:
Get-SPServiceApplication | fl
2.)
Once you found the ID check again you have the correct one via (the number might change):
Get-SPServiceApplication -Identity "044c8c2d-e127-43ec-b820-4bc20067bb18" | fl
Get-SPServiceApplication -Identity "a21c1a44-acab-41f3-9d85-447b5552fc47" | fl
It will list the “SharePoint Server ASP.NET Session State Service” and “State Service”.
3.)
Remove the Service application via (the number might change):
Remove-SPServiceApplication -Identity "044c8c2d-e127-43ec-b820-4bc20067bb18"
Remove-SPServiceApplication -Identity "a21c1a44-acab-41f3-9d85-447b5552fc47"
4.)
Now check if the proxy is also gone via:
Get-SPStateServiceApplicationProxy
If this isn´t the case it can be removed via central administration.
5.)
Now we need to recreate the “State Service” via:
$serviceApp = New-SPStateServiceApplication -Name “State Service” New-SPStateServiceDatabase -Name "EMEA_SharePoint_Farm1_State" -DatabaseServer "mysqlserver.contoso.com" -ServiceApplication $serviceApp New-SPStateServiceApplicationProxy -Name “State Service Proxy” -ServiceApplication $serviceApp -DefaultProxyGroup
6.)
Now we need to re-create the “SharePoint Server ASP.NET Session State Service” via:
Enable-SPSessionStateService -DatabaseServer "mysqlserver.contoso.com" -DatabaseName "EMEA_SharePoint_Farm1_SessionStateService"
Note 1:
According to the permissions and security settings article here, your main account only needs dbcreator and securityadmin rights!
Note 2:
There is an MSDN article that talks about the differences between the both services
Other references:
Using Session State in SharePoint 2010