Jaa


Configure Persistence Stores Using Windows Server AppFabric Cmdlets

This topic describes how to use AppFabric cmdlets to add, get, set, or remove configuration values for an instance store defined in a configuration file associated with the specified scope (root, Web site, application, and so on). It also describes cmdlets to create and initialize a SQL Server persistence database or remove persistence-related artifacts from a SQL Server persistence store.

Note

To execute an AppFabric cmdlet interactively, you will need to use the Windows PowerShell console for Windows Server AppFabric, enter the appropriate cmdlet, and then press ENTER. For more information about executing AppFabric cmdlets in general, see Running Windows Server AppFabric Cmdlets. For detailed information about scope parameters (-SiteName, -VirtualPath, -Uri, and so on), see Cmdlet Scope and for detailed information about piping parameters (ApplicationInfo and ServiceInfo), see Cmdlet Piping.

To add, get, set, or remove instance store definitions by using cmdlets

Cmdlet

Description

Add-ASAppSqlInstanceStore

Adds an instance store definition pointing to the specified named connection string or a connection string. An example of the cmdlet:

Add-ASAppSqlInstanceStore -root -Name TestInstanceStore -ConnectionStringName ApplicationServerWorkflowInstanceStoreConnectionString

Set-ASAppSqlInstanceStore

Sets or updates an instance store definition to point to the specified named connection string or a connection string. An example of the cmdlet:

Set-ASAppSqlInstanceStore -root -Name TestInstanceStore -ConnectionStringName ApplicationServerWorkflowInstanceStoreConnectionString

The named connection string is defined in the configuration file associated with the specified level or with the higher levels in the <connectionStrings> tag.

Remove-ASAppSqlInstanceStore

Removes an instance store registration in the configuration file associated with the specified scope. The value for the Name parameter specifies the name of the instance store to be removed. An example of the cmdlet:

Remove-ASAppSqlInstanceStore –root –Name TestInstanceStore

You can find store definitions in a configuration file in the <Microsoft.ApplicationServer>\<Persistence>\<InstanceStores> node.

Get-ASAppInstanceStore

Gets the information about the instance store that is associated with the specified scope. This information includes the name of the instance store, the name of the store provider for the store, site name, virtual path, and any parameters for the instance store such as the connection string for a SQL Workflow Instance Store. An example of the cmdlet:

Get-ASAppInstanceStore –root

Syntax options for the Add-ASAppSqlInstanceStore cmdlet

Add-ASAppSqlInstanceStore [-Root] -Name <String> [-ConnectionString <String>] [-ConnectionStringName <String>] [<CommonParameters>]

Add-ASAppSqlInstanceStore [-SiteName] <String> [[-VirtualPath] <String>] -Name <String> [-ConnectionString <String>] [-ConnectionStringName <String>] [<CommonParameters>]

Add-ASAppSqlInstanceStore [-Uri] <Uri> -Name <String> [-ConnectionString <String>] [-ConnectionStringName <String>] [<CommonParameters>]

Add-ASAppSqlInstanceStore -ApplicationObject <ApplicationInfo> -Name <String> [-ConnectionString <String>] [-ConnectionStringName <String>] [<CommonParameters>]

The following table lists the parameters that are specific to the Add-ASAppSqlInstanceStore cmdlet.

Parameter

Description

Name

Name of the instance store definition in the configuration file associated with the specified scope (root, site, application, and so on).

ConnectionString

A connection string that is used to connect to the store.

ConnectionStringName

Name of the connection string definition that is defined in a configuration file.

Syntax options for the Set-ASAppSqlInstanceStore cmdlet

Set-ASAppSqlInstanceStore [-Root] -Name <String> [-Confirm] [-ConnectionString <String>] [-ConnectionStringName <String>] [-WhatIf] [<CommonParameters>]

Set-ASAppSqlInstanceStore [-SiteName] <String> [[-VirtualPath] <String>] -Name <String> [-Confirm] [-ConnectionString <String>] [-ConnectionStringName <String>] [-WhatIf] [<CommonParameters>]

Set-ASAppSqlInstanceStore [-Uri] <Uri> -Name <String> [-Confirm] [-ConnectionString <String>] [-ConnectionStringName <String>] [-WhatIf] [<CommonParameters>]

Set-ASAppSqlInstanceStore -ApplicationObject <ApplicationInfo> -Name <String> [-Confirm] [-ConnectionString <String>] [-ConnectionStringName <String>] [-WhatIf] [<CommonParameters>]

The following table lists the parameters that are specific to the Set-ASAppSqlInstanceStore cmdlet.

Parameter

Description

Name

Name of the instance store definition in the configuration file associated with the specified scope (root, site, application, and so on).

ConnectionString

A connection string that is used to connect to the store.

ConnectionStringName

Name of the connection string definition that is defined in a configuration file.

Syntax options for the Remove-ASAppSqlInstanceStore cmdlet

Remove-ASAppSqlInstanceStore [-Root] -Name <String> [-Confirm] [-WhatIf] [<CommonParameters>]

Remove-ASAppSqlInstanceStore [-SiteName] <String> [[-VirtualPath] <String>] -Name <String> [-Confirm] [-WhatIf] [<CommonParameters>]

Remove-ASAppSqlInstanceStore [-Uri] <Uri> -Name <String> [-Confirm] [-WhatIf] [<CommonParameters>]

Remove-ASAppSqlInstanceStore -ApplicationObject <ApplicationInfo> -Name <String> [-Confirm] [-WhatIf] [<CommonParameters>]

The following table lists the parameters that are specific to the Remove-ASAppSqlInstanceStore cmdlet.

Parameter

Description

Name

Name of the instance store definition in the configuration file associated with the specified scope (root, site, application, and so on).

Syntax options for the Get-ASAppInstanceStore cmdlet

Get-ASAppInstanceStore [-Root] [-Name <String>] [<CommonParameters>]

Get-ASAppInstanceStore [-SiteName] <String> [[-VirtualPath] <String>] [-Name <String>] [<CommonParameters>]

Get-ASAppInstanceStore [-Uri] <Uri> [-Name <String>] [<CommonParameters>]

Get-ASAppInstanceStore -ApplicationObject <ApplicationInfo> [-Name <String>] [<CommonParameters>]

The following table lists the parameters that are specific to the Get-ASAppInstanceStore cmdlet.

Parameter

Description

Name

Name of the instance store definition in the configuration file associated with the specified scope (root, site, application, and so on).

To initialize or remove SQL Server persistence databases by using cmdlets

Cmdlet

Description

Initialize-ASPersistenceSqlDatabase

Creates and initializes a SQL Server persistence database on the specified database server if the specified database does not already exist on the server. The initialization process creates persistence-related artifacts (tables, views, stored procedures, and so on). If the database already exists on the server, the cmdlet initializes the database with the persistence artifacts. The cmdlet also adds the specified Windows groups to corresponding SQL Server roles. An example of the cmdlet:

Initialize-ASPersistenceSqlDatabase  -Database TempPersistenceDB -Server "(local)"

Remove-ASPersistenceSqlDatabase

Removes all the persistence artifacts (stored procedures, tables, views, and so on) from the specified database, but does not remove the database itself. An example of the cmdlet:

Remove-ASPersistenceSqlDatabase  -Database TempPersistenceDB -Server "(local)"

Syntax options for the Initialize-ASPersistenceSqlDatabase cmdlet

Initialize-ASPersistenceSqlDatabase -Database <String> [-Admins <String>] [-Confirm] [-Force] [-Readers <String>] [-Server <String>] [-Users <String>] [-WhatIf] [<CommonParameters>]

Initialize-ASPersistenceSqlDatabase -ConnectionString <String> [-Admins <String>] [-Confirm] [-Force] [-Readers <String>] [-Users <String>] [-WhatIf] [<CommonParameters>]

The following table lists the parameters that are specific to the Initialize-ASPersistenceSqlDatabase cmdlet.

Parameter

Description

Server

Name of the server on which the database resides.

Database

Name of the SQL Server persistence database.

ConnectionString

A connection string that is used to connect to a SQL Server persistence database.

You can either specify a server and database or specify a connection string that is used to connect to a SQL Server persistence database.

Admins

Adds the specified Windows group to InstanceStoreObservers, WorkflowActivationUsers, WorkflowAdministrators, and WorkflowManagementServiceUsers roles in the specified SQL Server persistence database.

Readers

Adds the specified Windows group to the InstanceStoreObservers role in the specified SQL Server persistence database.

Users

Adds the specified Windows group to the InstanceStoreUsers role in the specified SQL Server persistence database.

Syntax options for the Remove-ASPersistenceSqlDatabase cmdlet

Remove-ASPersistenceSqlDatabase -Database <String> [-Force] [-Server <String>] [<CommonParameters>]

Remove-ASPersistenceSqlDatabase -ConnectionString <String> [-Force] [<CommonParameters>]

The following table lists the parameters that are specific to the Remove-ASPersistenceSqlDatabase cmdlet.

Parameter

Description

Server

Name of the server on which the database resides.

Database

Name of the SQL Server persistence database.

ConnectionString

A connection string that is used to connect to a SQL Server persistence database.

You can either specify a server and database or specify a connection string that is used to connect to a SQL Server persistence database.