#### #### When SharePoint Server 2013 is installed, it assigns the Distributed Cache service 10 percent of the total memory on the server. #### It is recommended to allocate sufficient amount of memory on each Distributed Cache server. Please see http://technet.microsoft.com/en-us/library/jj219613.aspx#memory #### # Add distributed cache on the local server Add-SPDistributedCacheServiceInstance # Stop the Distributed Cache service #$instanceName ="SPDistributedCacheService Name=AppFabricCachingService" #$serviceInstance = Get-SPServiceInstance | ? {($_.service.tostring()) -eq $instanceName -and ($_.server.name) -eq $env:computername} #$serviceInstance.Unprovision() # STOP PROPERLY A CACHE HOST #Stop-SPDistributedCacheServiceInstance -Graceful #Remove-SPDistributedCacheServiceInstance #Add-SPDistributedCacheServiceInstance # Reconfigure the cache size of the Distributed Cache service: Use-CacheCluster Update-SPDistributedCacheSize -CacheSizeInMB 12288 # Start the Distributed Cache service: #$instanceName ="SPDistributedCacheService Name=AppFabricCachingService" #$serviceInstance = Get-SPServiceInstance | ? {($_.service.tostring()) -eq $instanceName -and ($_.server.name) -eq $env:computername} #$serviceInstance.Provision() #Test Cache cluster #Use-CacheCluster #Get-Cache #Get-CacheClusterHealth #Stop-CacheCluster #Start-CacheCluster #Restart-CacheCluster #Restart-CacheHost #Connect-AFCacheClusterConfiguration #Restart-AFCacheCluster #Export-CacheClusterConfig -path d:\clusterconfig.xml #Add-SPDistributedCacheServiceInstanceOnLocalServer #STOP PROPERLY A CACHE HOST # #Remove-SPDistributedCacheServiceInstance #Add-SPDistributedCacheServiceInstance #Get-CacheHostConfig FR0-PVSFSSPWFE1 22233 #"Distributed Cache"|set-sploglevel -traceseverity verbose #Get-AFCacheHostStatus | % {$ServerName = $_.HostName Get-AFCacheStatistics -ComputerName $_.HostName -CachePort $_.PortNo | Add-Member -MemberType NoteProperty -Name 'ServerName' -Value $ServerName -PassThru} | Format-List -Property * #DELETE DC SERVICE INSTANCE (Host info null) (| Out-File c:\test.txt) get-spserviceinstance | Out-File "c:\test.txt" #$s = get-spserviceinstance GUID #$s.delete()