If you have several servers in your SharePoint Server (on-premises) farm, repeating the manual steps for clearing the configuration cache on each can be time consuming. PowerShell really shines in situations like these to help us be more productive and efficient.
The following PowerShell script can be used to clear the SharePoint configuration cache on a server. I’ve recently tested this on SharePoint 2019 servers with success. Just be sure to run it on each server for which you’re clearing the cache, then remember to go back to each and press “ENTER” in each PowerShell window as the script instructs you so that it restarts the timer service after all servers have had their cache cleared.
This script follows the same steps you’d perform manually. It loads the SP snap-in if needed, stops the timer service, deletes the xml files in the Config directory, sets the cache.ini file’s value to 1 to reset the cache, then restarts the timer service (once you press Enter).
Clear SharePoint configuration cache using PowerShell
Run PowerShell as administrator (right-click, run as administrator).
Copy and paste the following script, making no changes to its contents. It will work as-is.
Hit Enter to run the script (unless using ISE, then click “Run”).
Repeat steps 1-3 for each SharePoint server on which you’re clearing the cache.
When this has run on all SharePoint servers you wish, go back to each and hit Enter in PowerShell to restart the timer service on each.
I recently ran into the following error message when using OneDrive for Business via MySites (on-prem 2016).
“No free space. Your site is out of storage space and changes can’t be saved…”
The recommendation is to empty your recycle bin, but the recycle bin is probably empty.
The default storage limit for MySites is set to 100 MB (which doesn’t go so far these days).
If you already have a bunch of personal sites created, it’s not as easy as tweaking the quota template. You will need to update the quota template for future sites, then reset all existing sites to use the updated template as well.
Update the Quota Template
Go to Central Admin
Click “Application Management”
Click “Specify quota templates” under “Site Collections”
Change the “Personal Site” template to allow for more storage (I’d suggest at least 10GB, entered as 10240MB, but this will vary based on usage, industry, available space, etc.)