Share via


SharePoint 2016: How To Configure State Service Application Using PowerShell

There are many SharePoint Components like InfoPath Form Services, Visio, Search Service, Workflows and many more, relies on SharePoint State Service Application to application sessions across related HTTP(S) requests in a SQL Server Database.

In this article, we will discuss the steps involved in configuring SharePoint State Service Application using PowerShell

First, let us go to Central Administration Site to make sure that State Service Application is not available to be provisioned from the UI.

Go to “Central Administration” -> “Application Management” and click on “Manage Service Application”

https://howtodowithsharepoint.files.wordpress.com/2017/12/2.png?w=800

On Service Application Page, Click “New” Menu in Ribbon Bar to see list of Service Applications that we provision from this UI and we can see State Service Application is missing from this list

That means we can provision this Service Application only using PowerShell and that what we are going to do in this article.

https://howtodowithsharepoint.files.wordpress.com/2017/12/3.png?w=800

In order to provision the service application using PowerShell, launch “SharePoint 2016 Management Shell” and perform the following steps-

https://howtodowithsharepoint.files.wordpress.com/2017/12/1.png?w=800

https://howtodowithsharepoint.files.wordpress.com/2017/12/4.png?w=800

Step 1: Provision Service Application Instance

In this step we will provision the State Service using “New-SPStateServiceApplication” cmdlet as shown below

New-SPStateServiceApplication -Name "State Service Application"

https://howtodowithsharepoint.files.wordpress.com/2017/12/5.png?w=800

Step 2: Provision Service Application Proxy

In this step we will provision Service Application Proxy for State Service by using the following command

Get-SPStateServiceApplication| New-SPStateServiceApplicationProxy –defaultproxygroup

https://howtodowithsharepoint.files.wordpress.com/2017/12/6.png?w=800

Step 3: Provision Database for State Service Application

In this Step, we will provision database for State Service Application using the following command. We choose “State_Service_Database” as database name

Get-SPStateServiceApplication| New-SPStateServiceDatabase -Name "State_Service_Database"

https://howtodowithsharepoint.files.wordpress.com/2017/12/7.png?w=800

Step 4: Install the State Database Schema

In this step we will install the database schema into State Service Database by using following command

Get-SPDatabase | where-object {$_.type -eq "Microsoft.Office.Server.Administration.StateDatabase"} | Initialize-SPStateServiceDatabase

https://howtodowithsharepoint.files.wordpress.com/2017/12/8.png?w=800

Step 5: Verify Service Application

In this step we will verify the provisioning of service application by looking at “Service Application” Page in “Central Administration” as shown below-

https://howtodowithsharepoint.files.wordpress.com/2017/12/9.png?w=800

Step 6: Verify Service Application Database

In this step we will verify the provisioning of service application database by logging into “SQL Server Management Studio” as shown below-

https://howtodowithsharepoint.files.wordpress.com/2017/12/10.png?w=800https://howtodowithsharepoint.files.wordpress.com/2017/12/11.png?w=800

This concludes the Service Application Provisioning Process using PowerShell.

Hope you find it helpful.