SharepointConfigCacheReset

1.19

For more info and screenshots go to:
   https://www.sysadmin-diary.com/sharepoint-config-cache-reset/
Make sure to run the script with "-TestOnly" switch to test the script first without doing the actual reset.
The script performs the following main steps:
   Searches for the configuration database GUID.
   Searches for the config cache folder based on the Database
For more info and screenshots go to:
   https://www.sysadmin-diary.com/sharepoint-config-cache-reset/
Make sure to run the script with "-TestOnly" switch to test the script first without doing the actual reset.
The script performs the following main steps:
   Searches for the configuration database GUID.
   Searches for the config cache folder based on the Database GUID.
   Stops the timer service.
   Removes XML files in the config cache folder.
   Sets the cache.ini content to 1.
   Starts the timer service.
By default each main step is executed on all servers before the script goes to the next step.
With "-ServerByServer" switch all main steps are executed on one server then another etc...
You can use "-ServerList" switch to run the script only on specific servers, not the whole farm.
Show more

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Script -Name SharepointConfigCacheReset

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Package Details

Author(s)

  • jan.tkac.sk@gmail.com

Tags

Sharepoint Config Cache Reset

Functions

Write-Section Load-SharePoint-Powershell Write-FarmInfo Test-RemoteWMIAccess Test-ConfigCacheFolders Check-Cache_iniContent Check-XMLFiles Stop-SPTimerService Start-SPTimerService Wait-TimerService Remove-XMLFiles Set-Cache_iniContent

Dependencies

This script has no dependencies.

Release Notes

1.0
Added foreach loop to to all funcions to be able to use it with multiple servers.
1.1
Added [string[]]$Servers parameter to be able to run the script for only one server.
Added Write-Section function to visibly separate sections using write-host commandlet.
1.2
Added [switch]TestOnly parameter to Start-SPTimerservice,Stop-SPTimerService,Remove-XMLFiles and Set-Cache_iniContnet functions.
1.4
Added [switch]$ServerByServer parameter to the script.
Changes in the main script block.
1.5
Added and removed some empty lines in the host output.
1.6
Added if($ServerByServer -and -not $TestOnly) condition.
1.7
Added Write-FarmInfo function.
1.8
Added a "-subsection" switch to the Write-Section function, removed Set-Content -Whatif line.
1.9
Added  write-subsection lines, edite text of some write-host lines in (-not $TestOnly -and $ServerByServer) condition.
1.10
Script parameter "[string[]]$Servers" was changed to "$[string[]]$ServerList".
In each function "$Servers" was changed to "$ComputerList".
In each function "foreach ($Server in $Servers)" was changed to "foreach $(Computer in $ComputerList)".
Main script slock Was adusted according to the changes above.
Added Write-Host part in the Load-Sharepoint-Powershell function.
1.11
Edited PSSCriptInfo
1.12
Simplified versioning
1.13
Changed The color scheme
1.18
Metadata update
1.19
Added do-until with try-catch block in Check-Cache_iniContent. If the cache.ini file cannot be read, the script will wait.

FileList

Version History

Version Downloads Last updated
1.19 (current version) 18 6/23/2023
1.18 7 3/30/2023