I'm trying to grab the Distributed Cache service using PowerShell so I can change the managed account that runs it. This cannot be changed through the CA UI.
I am not able to get the service using any of the following PowerShell commands (they return a null object).
$farm is set using
$farm = get-spfarm
$farm.services | where ($_.TypeName -eq "Distributed Cache") $farm.services | where ($_.Id -eq "<The GUID of the distributed cache service>") $farm.services | where ($_.TypeName -match "Distributed" $farm.services | where ($_.TypeName -like "*Distributed*")
I am running PowerShell as a local administrator and as the farm administrator. Again, all of these lines return a null object. AFAIK any of these should get me the cache service. I can see it listed when I just enter
$farm.services but somehow the pipe-filtering (?) is not working properly.
I'm not able to get any of the other services using this method.