Export (0) Print
Expand All

New-SPStateServiceDatabase

Published: July 16, 2012

Applies to:  SharePoint Server 2013 Enterprise 

Creates and provisions a new state service database, and installs the state database schema into it.

New-SPStateServiceDatabase [-Name] <String> [-AssignmentCollection <SPAssignmentCollection>] [-DatabaseCredentials <PSCredential>] [-DatabaseServer <String>] [-ServiceApplication <SPStateServiceApplicationPipeBind>] [-Weight <Nullable>]

Parameters

Parameter Required Type Description

Name

Required

System.String

Specifies the name for the state service database that is stored in SQL Server.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

noteNote:

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

DatabaseCredentials

Optional

System.Management.Automation.PSCredential

Specifies the database credentials for SQL Authentication used to access the state service database. If this parameter is not specified, Windows authentication is used.

The type must be a valid PSCredential object.

DatabaseServer

Optional

System.String

Specifies the name of the host server for the state service database.

The type must be a valid SQL Server host name; for example, SQLServerHost1.

ServiceApplication

Optional

Microsoft.Office.Server.Administration.SPStateServiceApplicationPipeBind

Specifies the state service application to add the state database to.

The type must be a valid name of a state service application (for example, StateServiceApp1); a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; or an instance of a valid SPStateServiceApplication object.

Weight

Optional

System.Nullable

Specifies the weight for the state database. The default value is 1.

This parameter is used when new rows of data are allocated among the collection of databases that are associated with a service application

The type must be a valid integer in the range of 1 to 10.

Detailed Description

The New-SPStateServiceDatabase cmdlet creates and a new state service database. This cmdlet installs the session state database schema in the state service database.

Input Types

Return Types

--------------EXAMPLE 1-----------------

Get-SPStateServiceApplication –name “State Service Application 1” | New-SPStateServiceDatabase –Name “statedata1” –DatabaseServer “localhost”

This example creates a new state service database by using Windows authentication, and associates it with the provided service application.

--------------EXAMPLE 2-----------------

$cred = Get-Credential
Get-SPStateServiceApplication –name “State Service Application 1” | New-SPStateServiceDatabase –Name “statedata1” –DatabaseServer “localhost” –DatabaseCredentials $cred

This example creates a new state service database, a new state service application associated with the database and a new state service application proxy associated with the state service application proxy.

This example configures all the objects required to have State Service operational on a farm.

Change History

Date Description

July 16, 2012

Initial publication

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft