Wednesday, April 29, 2015

How to change account for Distributed Cache Service in SP 2013?

One need to have managed account to run the distributed cache serverice under that. Below is the powershell command to change or run the service:-


$farm = Get-SPFarm
$cacheService = $farm.Services | where {$_.Name -eq "AppFabricCachingService"}
$accnt = Get-SPManagedAccount -Identity domain_name\user_name
$cacheService.ProcessIdentity.CurrentIdentityType = "SpecificUser"
$cacheService.ProcessIdentity.ManagedAccount = $accnt
$cacheService.ProcessIdentity.Update() 
$cacheService.ProcessIdentity.Deploy()


You can also Start the service as below:-

Add-SPDistributedCacheServiceInstance

and to remove a Cache host:-


Remove-SPDistributedCacheServiceInstance