Cache Configuration with Windows PowerShell (AppFabric 1.1 Caching)

There are two ways to configure the Microsoft AppFabric 1.1 for Windows Server Caching Service: the AppFabric Configuration Wizard user interface and a set of Windows PowerShell commands for AppFabric Caching. This topic describes the Windows PowerShell commands. For more information on using the AppFabric Configuration Wizard, see Configure AppFabric.

If you are using a computer with the Cache Administration feature installed, you can go to the Start Menu, click All Programs, Microsoft AppFabric 1.1 for Windows Server, and then click Caching Administration Windows PowerShell. Following this, you must manually import the Windows PowerShell module that contains the configuration commands. This is shown in the following example.

Import-Module DistributedCacheConfiguration

Note

You must run Windows PowerShell with administrative privileges for some administration commands to work correctly. For the Caching Administration Windows PowerShell shortcut, right-click the shortcut and select Run as administrator.

Command Name Changes in the Cumulative Update for AppFabric 1.1

The Cumulative Update for AppFabric 1.1 update included name changes to the Windows PowerShell commands for AppFabric. These changes improve the understandability and consistency of the commands. The following tables include the original command name (RTM) and the updated command. To obtain the update, see Cumulative update package 2 for Microsoft AppFabric 1.1 for Windows Server.

In order to preserve backwards compatibility, a PowerShell script has been provided to alias the new commands with the old command names. Any parameter name changes have been aliased within the PowerShell module itself.

Getting Help within the Windows PowerShell Session

The information below provides a summary of the administration commands for the caching features of AppFabric. It is important to realize that you can get help inside your Windows PowerShell session as well. For example, the following command displays all of the configuration commands:

get-command -module DistributedCacheConfiguration

If you need help on a particular command, you can use the get-help command to do this. For example, the following command displays the complete help for the Add-CacheHost command:

get-help Add-CacheHost -full

Configuration Commands

There are two main categories of AppFabric Caching PowerShell commands: administration commands and configuration commands. This topic focuses on configuration commands. For more information on the administration commands, see Using Windows PowerShell to Manage AppFabric 1.1 Caching Features. The following table lists the Windows Powershell commands available to configure the Caching Service.

Command (RTM) Command (QFE) Description

Add-CacheAdmin

Add-AFCacheAdminLocalConfiguration

Configures Cache Administration on the cache host. This command operates on the server locally.

Add-CacheHost

Add-AFCacheHostLocalConfiguration

Configures a cache host to enable it to become part of an existing cluster. This command operates on the server locally.

Get-CacheClusterInfo

Get-AFCacheCluster

Returns the cache cluster information, including details on its initialization status and its size.

Get-CacheConnectionString

Get-AFCacheTemporaryConnectionString

Returns the temporary connection string that was set with the Set-CacheConnectionString command. Note that this command does not necessarily reflect the connection string used by the cache cluster configuration store.

Note

This command is used internally by Microsoft AppFabric 1.1 for Windows Server. There are no known user scenarios requiring its use.

New-CacheCluster

New-AFCacheClusterConfiguration

Creates and initializes a new cache cluster configuration store.

Register-CacheHost

Register-AFCacheHost

Adds a cache host to the specified cache cluster configuration store.

Remove-CacheAdmin

Remove-AFCacheAdminLocalConfiguration

Un-configure Cache Administration from the cache host. This command operates on the server locally.

Remove-CacheCluster

Remove-AFCacheClusterConfiguration

Removes an existing cluster configuration.

Remove-CacheHost

Remove-AFCacheHost

Un-configures a cache host that is not currently a member of a cache cluster. This command operates on the server locally.

Set-CacheConfigurationLog

Set-AFCacheConfigurationLogging

Sets a custom log file location to use for configuration commands logging. By default, the logs reside in the Temp folder.

Set-CacheConnectionString

Set-AFCacheTemporaryConnectionString

Persists the connection string for temporary usage. The string can then be retrieved with Get-CacheConnectionString. Note that this command does not change the connection string used by the cache cluster configuration store.

Note

This command is used internally by Microsoft AppFabric 1.1 for Windows Server. There are no known user scenarios requiring its use.

Test-CacheClusterConnection

Test-AFCacheClusterConnection

Tests the connection to a cache cluster configuration store.

Unregister-CacheHost

Unregister-AFCacheHost

Removes a cache host entry from a cache cluster configuration store. If the current host is being un-registered, the HostName parameter is not required. In this case, the Provider and ConnectionString parameters are also optional, assuming that the current cache host is configured and the Remove-CacheHost command has not been called on the cache host.

Warning

Stop-CacheHost must be called to stop a cache host before unregistering it. If this is not done, there is a possibility of a service crash.

See Also

Concepts

Using Windows PowerShell to Manage AppFabric 1.1 Caching Features
Configuration Settings
AppFabric Caching Configuration Options
Troubleshooting AppFabric Caching
AppFabric Caching Concepts (AppFabric 1.1 Caching)
Developing a Cache Client

  2012-10-26