Change the Caching Service Account (AppFabric 1.1 Caching)

Microsoft AppFabric 1.1 for Windows Server allows you to run the AppFabric Caching Service as a built-in account or as a custom domain account. Running the service as a custom domain account was previously not supported in Windows Server AppFabric v1.0. This topic describes how to change the AppFabric Caching Service account using two methods:

  1. Using the Configuration Wizard

  2. Using Windows PowerShell

The service account must be updated on each cache host individually, and each cache host must be stopped prior to the changes. The easiest way to accomplish this is to use the Stop-CacheCluster Windows PowerShell command to stop all hosts in the cluster. However, you can choose to leave the cache cluster running and update the servers sequentially by using Stop-CacheHost, updating that cache host, and then using Start-CacheHost before moving to the next server.


It is not recommended to use a custom service account with Administrator privileges on the cache host.


You must stop the cache cluster if you are changing between a built-in account, such as NETWORK SERVICE, to a custom account, such as a domain account. You also should restart cache client applications in this scenario.

Using the Configuration Wizard

The Configuration Wizard allows you to update the AppFabric Caching Service with a user interface.

  1. On the Start Menu, select Microsoft AppFabric 1.1 for Windows Server, and then click Configure AppFabric.

  2. Proceed through the configuration steps until you get to the Caching Service section.

  3. Select the Set Caching Service configuration check box.

  4. Click the Change button next to the Caching Service account text box.

  5. In the Select User dialog box, enter the account information and click OK.

  6. Select the Caching Service configuration provider and point to the current configuration store for the current cache cluster.

  7. Select the Join cluster radio button.

  8. Click Next, and complete the caching service configuration to apply the changes to the AppFabric Caching Service account.

  9. Start the cache host with either Start-CacheHost or Start-CacheCluter Windows PowerShell commands.

Using Windows PowerShell

The following steps show another technique for changing the AppFabric Caching Service account by using Windows PowerShell. For information on how to use the configuration commands below, see Automated Installation and Configuration (AppFabric 1.1 Caching).

  1. If the target cache host is still running, stop the cache host with Stop-CacheCluster or Stop-CacheHost.

    Stop-CacheHost CacheServer1 22233
  2. Use UnRegister-CacheHost to remove the cache host from the cache cluster.

    Unregister-CacheHost -Provider System.Data.SqlClient -ConnectionString "Data Source=SQLSERVER1;Initial Catalog=CachingDB;Integrated Security=True" -HostName CacheServer1
  3. Use Remove-CacheHost to remove the cache host configuration from the server. This command must be run from the target cache host.

  4. Change the service account using the Services Administrative Tool or by using the sc.exe command.

    sc.exe config AppFabricCachingService obj= DOMAIN\user1 password= user1_password


    If you use a custom service account, it must have the Log on as a service right. For more information on how to grant this right, see Add the Log on as a service Right to an Account.

  5. Use Add-CacheHost to configure the cache host. Specify the new account with the Account parameter.

    Add-CacheHost -Provider System.Data.SqlClient -ConnectionString "Data Source=SQLSERVER1;Initial Catalog=CachingDB;Integrated Security=True" -Account "DOMAIN\user1"
  6. Use Register-CacheHost to register the cache host with the cache cluster. Specify the new account with the Account parameter.

    Register-CacheHost -Provider System.Data.SqlClient -ConnectionString "Data Source=SQLSERVER1;Initial Catalog=CachingDB;Integrated Security=True"  -Account "DOMAIN\user1" -CachePort 22233 -ClusterPort 22234  -ArbitrationPort 22235 -ReplicationPort 22236 -HostName CACHESERVER1
  7. Start the cache host with either Start-CacheHost or Start-CacheCluter.

See Also


Configuring the Cache Cluster