Clear Configuration Cache - SharePoint 2013

This script has been written to clear configuration cache from all SharePoint servers in the SharePoint farm. It makes a query against SharePoint farm to get list of all servers and leaves out mail and SQL server. After then, it proceeds to clear cache. This script has been com

4.6 Star
4,980 times
Add to favorites
E-mail Twitter Digg Facebook
  • runing in SP 2016
    2 Posts | Last post February 20, 2020
    • when running in SP 2016 unlike 2013 it is done just for servers which the role is Application because in script "Where-Object {$_.Role -eq "Application"}" is used
      the question is if we removed this part it would work all SP 2016 servers.
    • Try changing {$_.Role -eq "Application"}"  to {$_.Role -ne "Invalid"}.  Works for me.
  • Getting Access Denied while deleting .xml files
    1 Posts | Last post June 29, 2018
    • On one of application server I am always getting access denied error for 3 *.xml files...
      I am sure the service is stopped before the code goes for deletion.
      This issue is occurring always for those 3 specific xml files..
      Any help would be highly appreciated.
      Exception calling "Delete" with "0" argument(s): "Access to the path
      '4c211011-a9ad-4172-b459-5d30e23dc484.xml' is denied."
      At C:\Users\sidshs02\Desktop\SP_ClearConfigCache.ps1:52 char:15
      +               $cachefolderitem.Delete()
      +               ~~~~~~~~~~~~~~~~~~~~~~~~~
  • Error Handling & Config Backup
    4 Posts | Last post February 13, 2018
    • The script works great, but has no error handling, and does not back up the config objects before deleting. Would be a 5 star script if these two items were added.
    • Thanks Mohit for putting this together. Works like a charm!
    • Thanks for feedback. It now takes backup of config objects before deleting. Hope you like it.
    • Nice work!!
      I think there is an issue when we re-run this.
      It again checks for Cache.ini in backup file and recursively takes its backup.