Enable Session State

Scenario/Problem: You want to enable session state for your SharePoint Web Applications.

Solution: Use the Enable-SPSessionStateService cmdlet.

The Session State Service is not enabled by default, so there is no database to manage session state. This is actually the ASP.NET session state that can be leveraged by the SharePoint web applications in your farm.

To enable session state, execute the Enable-SPSessionStateService cmdlet with the DefaultProvision parameter. This automatically creates the session state database and enables the service using default values. Listing 18.1 shows an example command line.

Listing 18.1. Enabling Session State Using Defaults

Enable-SPSessionStateService -DefaultProvision

The default database ...

Get PowerShell™ for SharePoint® 2013 How-To now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.