Поділитися через


Cache Configuration with Windows PowerShell (Windows Server AppFabric Caching)

There are two ways to configure the Windows Server AppFabric 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 Windows Server AppFabric.

If you are using a computer with the Cache Administration feature installed, there are two ways of using Windows PowerShell for managing the caching features of AppFabric. On the Start Menu, go to Administrative Tools, and then select Windows PowerShell Modules. Or you can go to the Start Menu, click All Programs, Windows Server AppFabric, and then click Caching Administration Windows PowerShell.

Note

On the Windows Vista, Windows 7, and Windows Server 2008 operating systems, you must run Windows PowerShell with administrative privileges for some configuration commands to work correctly. For the Caching Administration Windows PowerShell shortcut, you must right-click the shortcut and select Run as administrator.

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 Windows Server AppFabric Caching Features. The following table lists the Cache Administration Windows Powershell commands available to configure the Caching Service.

Command Description

Add-CacheAdmin

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

Add-CacheHost

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

Get-CacheClusterInfo

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

Get-CacheConnectionString

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 Windows Server AppFabric. There are no known user scenarios requiring its use.

New-CacheCluster

Creates and initializes a new cache cluster configuration store.

Register-CacheHost

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

Remove-CacheAdmin

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

Remove-CacheCluster

Removes an existing cluster configuration.

Remove-CacheHost

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

Set-CacheConfigurationLog

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

Set-CacheConnectionString

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 Windows Server AppFabric. There are no known user scenarios requiring its use.

Test-CacheClusterConnection

Tests the connection to a cache cluster configuration store.

Unregister-CacheHost

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.

See Also

Concepts

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