Friday, September 11, 2015

Start and Stop the Distributed Cache Service PowerShell

How to start and stop Distributed Cache Service using SharePoint Management Shell?


# Start the Distributed Cache service by using Windows PowerShell     
     
$InstanceName = "SPDistributedCacheService Name=AppFabricCachingService";           
$serviceInstance = Get-SPServiceInstance | ? {($_.service.tostring()) -eq $instanceName -and ($_.server.name) -eq $env:computername}           
$serviceInstance.Provision();           
            
# Stop the Distributed Cache service by using Windows PowerShell       
   
$instanceName = "SPDistributedCacheService Name=AppFabricCachingService"           
$serviceInstance = Get-SPServiceInstance | ? {($_.service.tostring()) -eq $instanceName -and ($_.server.name) -eq $env:computername}           
$serviceInstance.Unprovision();


No comments:

Post a Comment