Home > Powershell, Service Application, Setup, SharePoint 2010, SharePoint Server 2010, State Service > Create a new ‘State Service’ Service Application using Powershell

Create a new ‘State Service’ Service Application using Powershell

February 14, 2012 Leave a comment Go to comments

I encountered this issue and had some trouble finding the correct info on it, so I thought that I’s share a good guide with all of you.

If you have made the correct choice to not run the configuration wizard to install all of the Service Applications…then you may encounter that you are missing the State Service Application. It can also be from deleting it after it was created by the wizard…
This Service Application is not available for creation in the New dialog in Central Administration, Manage Service Application, so it requires some special treatment.

An example of how it can look when this service Application is missing can look like this (in Health analyzer):

Title : InfoPath Forms Services forms cannot be filled out in a Web browser because no State Service connection is configured.
Severity : 2 – Warning
Category : Configuration
Explanation : InfoPath Forms Services is not functional on the following Web applications because there is no service connection configured for the State Service: SharePoint – 80
Remedy : If a State Service application doesn’t exist, create one by using the new-SPStateServiceApplication Powershell commandlet. For more information on configuring the State Service, see Help. For more information about this rule, see “http://go.microsoft.com/fwlink/?LinkID=142645“.
Failing Servers: XXXXXXXX
Failing Services: SPTimerService (SPTimerV4)

The obvious command new-SPStateServiceApplication  gives you this:

PS C:\Media\ConfigScript> New-SPStateServiceApplication  -Name “State Service Application” -Database “SharePoint_Service _State” New-SPStateServiceApplication : The pipeline has been stopped. At line:1 char:30 + New-SPStateServiceApplication <<<<   -Name “State Service Application” -Database “SharePoint_Service_State”     + CategoryInfo          : InvalidData: (Microsoft.Offic…plicationCmdlet:NewStateServiceApplicationCmdlet) [New-S    PStateServiceApplication], PipelineStoppedException     + FullyQualifiedErrorId : Microsoft.Office.Server.Administration.NewStateServiceApplicationCmdlet

New-SPStateServiceApplication : The specified object was not found. Parameter name: Database At line:1 char:30 + New-SPStateServiceApplication <<<<   -Name “State Service Application” -Database “SharePoint_Service_State”     + CategoryInfo          : InvalidArgument: (Microsoft.Offic…plicationCmdlet:NewStateServiceApplicationCmdlet) [N    ew-SPStateServiceApplication], ArgumentException     + FullyQualifiedErrorId : Microsoft.Office.Server.Administration.NewStateServiceApplicationCmdlet

Do not let this put you down, the correct way to create a new State Service Application is a bit different, no thanks to the get-help command…the syntaxt to use is as follows:

1. $serviceApp = New-SPStateServiceApplication -Name “State Service Application”
2. New-SPStateServiceDatabase -Name “SharePoint_Service_State” -ServiceApplication $serviceApp
3. New-SPStateServiceApplicationProxy -Name “State Service Application Proxy” -ServiceApplication $serviceApp -DefaultProxyGroup

Thats it!

Good luck.

Advertisements
  1. February 17, 2012 at 00:05

    It worked for me but how can I be sure that my State Service is now properly created and running?

    • February 26, 2012 at 17:48

      Hi Qazi.
      Sorry for the slow reply.
      Once the state service application and proxy are created, they will show up under Manage Service Applications, status should read ‘started’ on both.
      Do the same using Powershell:
      $MyStateService = Get-SPStateServiceApplication
      $MyStateService.status

      If status says ‘Online’ then the service is operational.
      Regards // Thomas

      • February 27, 2012 at 04:27

        Perfect.
        Thanks

  2. March 12, 2012 at 16:45

    Thanks for helping us to resolve warning message about “InfoPath Forms Services forms cannot be filled out in a Web browser because no State Service connection is configured.”

    • March 12, 2012 at 19:33

      No worries Usman, glad I could help!

      • Darkmoutch
        July 20, 2012 at 15:57

        New-SPStateServiceApplicationProxy -Name “State Service Application Proxy” -ServiceApplication >>>>> $serviceApp -DefaultProxyGroup

        What is parameter bettween -ServiceApplication and $serviceApp ?!

        this command line do not work

      • July 22, 2012 at 05:29

        Hi.
        It does work.
        The parameters in line 3 as you refer to are these:
        3. New-SPStateServiceApplicationProxy -Name “State Service Application Proxy” -ServiceApplication $serviceApp -DefaultProxyGroup
        -Name = “Any name you want to give it really”
        -ServiceApplication = An StateServiceApplication object, the one you created in line 1.
        You have to use all 3 lines of code, you can’t just skip to line 3. If the $erviceApp is empty, then it will fail.
        Try it again and you will see that it does work.

        Regards // Thomas

  3. Esteban
    October 9, 2012 at 16:09

    It works. Thanks so much.

  4. February 27, 2015 at 21:06
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: