SharePoint 2013 Config Cache fix mostly unstable service or applications, try with cache clear script as troubleshoot them in farm level. Here the scripts makes perfect with dynamic values of GUI ID and other parameters.
Standalone farm clean can be done manually but if its multi-tier farm would time conservation so better do with powerful tool. Tweak with below dynamic script that not require any additional changes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
<# .DESCRIPTION Clear SharePoint Config Cache with dynamic values .NOTES Author: Sathiya.io #> if((Get–PSSnapin | Where {$_.Name –eq “Microsoft.SharePoint.PowerShell”}) –eq $null) { Add–PSSnapin Microsoft.SharePoint.PowerShell; } function Man–Main { try { $cacheFolder = $null $items = $null $item = $null $a = $null $cacheFolderName = (Get–ItemProperty –Path “HKLM:SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\15.0\Secure\ConfigDB”).id if($cacheFolderName –ne $null) { Stop–Service SPTimerV4 $cacheFolder = “$env:ProgramData\Microsoft\SharePoint\Config\$cacheFolderName” $items = Get–ChildItem $cacheFolder foreach ($item in $items) { if ($item.Extension –eq “.xml”) { $item.Delete() #Write-Host $item.name “file has been deleted” } } $a = Get–Content $cacheFolder\cache.ini $a = 1 Set–Content $a –Path $cacheFolder\cache.ini Write–Host “Cache files are deleted successfully” –ForegroundColor Gray –BackgroundColor Green Start–Service SPTimerV4 } else { return [System.String](“[WARNING]:No SharePoint instance found in the server”) } } catch { Write–Output “Error clearing SharePoint cache” } } Man–Main |
Cheers!
Leave a Reply