$farm = Get-SPFarm

$cacheService = $farm.Services | where {$_.Name -eq “AppFabricCachingService”}

$accnt = Get-SPManagedAccount -Identity AD\xxx_SP_Farm

$cacheService.ProcessIdentity.CurrentIdentityType = “SpecificUser”

$cacheService.ProcessIdentity.ManagedAccount = $accnt

$cacheService.ProcessIdentity.Update()

$cacheService.ProcessIdentity.Deploy()