Having issues with Microsoft / Office Apps? A cluttered cache can sometimes lead to unexpected behavior. This guide demonstrates how to clear the Microsoft Apps cache on demand with Intune, potentially resolving various app-related problems.
This blog post covers cache cleanup for all Microsoft 365 applications (Office apps) except Outlook.
Table of Contents
- Benefits of Clearing the Microsoft Apps Cache
- Clear Microsoft Apps Cache Manually
- Using a Script for Automatic Cleanup
- Alternative Solutions
Benefits of Clearing the Microsoft Apps Cache
- Improved Performance: Clearing the cache can streamline apps by removing potentially outdated or corrupted data.
- Enhanced Stability: Removing cached data can sometimes resolve crashes, freezes, or other stability issues within apps.
- Faster Troubleshooting: This method quickly eliminates the user cache as a potential culprit, allowing you to focus on other troubleshooting steps if necessary.
Clear Microsoft Apps Cache Manually
- Close all your Office Applications
- Open this folder: %LOCALAPPDATA%\Microsoft\Office\16.0\Wef\
(you can copy an past the variable, it will automatically redirect you to the right location) - Delete all the content in this folder
Using a Script for Automatic Cleanup
Similar to the Teams cache cleanup, a PowerShell script can be created to automate the process for Microsoft Apps.
Here's a general outline:
- The script identifies the cache location.
- It checks if the applications are running.
- If one or more applications are running, a prompt would inform the user to close it before proceeding.
- Upon confirmation, the script closes the apps and clears the cache.
Setup the Remediation in Intune
Download the Script
Save the code as a .ps1
file (e.g., ClearMSAppsCache_DetectionAction.ps1
) or download it from GitHub (above).
Create a Remediation Package in Intune
- Navigate to: Intune > Devices > Windows > Scripts and remediations
- Hit + Create
- Give your package a name and a optional description.
- Upload the previous saved PowerShell script.
(Since everything in in one script, we only need the detection)- In addition, set the script to run as the logged-on user in in 64bit context.
- All the other points you can skip, including the assignment. Cause we will use it only for on-demand actions.
Remediation on-demand in action
Here is a video that shows you how the on-demand remediation to clear the Microsoft 365 Apps cache in Intune works. (The video is in real time.)
Alternative Solutions
- Reinstall the App: If clearing the cache doesn't resolve the issue, consider reinstalling the Microsoft App. This will remove all app data and reinstall it from scratch.
- Office Repair: This is a "light" option of the reinstall.
Awesome guide an extremely helpful! I also prepared a guide on how to accomplish a repair for the Edge Browser using Remediation via Intune as this is becoming a bigger focus as more ppl use Edge to install their PWAs and customize their Edge Organizational Branding via EMX in the Microsoft Admin Center. Thank you! You can open the guide for my Edge script here: https://netlogiccomputer.sharepoint.com/:w:/t/PublicResources/Ebyr1byip-NCt5_lGbOUukoB3i6mTxqtwLeCDmnc3tUXYA?e=ahzUlz
Nice one! This is a quick and easy way to try and resolve cache issues. Also thank you to David Swenson for that!