How to Automatically Delete Local SharePoint Files When Permissions are Revoked
Question details
The user wants to automatically remove locally downloaded SharePoint files and stop OneDrive synchronization on a workstation as soon as the user's access permissions to the folder are revoked.
- Product
- Microsoft SharePoint / OneDrive
- Device & OS
- not provided
- Scenario
- Revoking user permissions to a synchronized SharePoint folder and ensuring local copies are removed.
- Observed behavior
- When permissions are revoked, OneDrive synchronization stops or requires manual intervention, but previously downloaded files remain accessible on the local workstation.
Ensure you have administrative access to Microsoft Intune or Group Policy management for your organization, as these configurations require IT administrator privileges.
Configure the Intune Policy to Hard-Delete Synced Folders
The most reliable method to ensure files are removed after permissions are lost is to configure the specific administrative policy for OneDrive via Microsoft Intune.
Microsoft provides a dedicated policy specifically intended to remove synchronized contents immediately after a user loses access to the folder.
Log in to the Microsoft Endpoint Manager (Intune) admin center with administrative credentials.
Navigate to Devices > Configuration profiles and select or create a new profile for Windows 10/11 devices using the Settings Catalog or Administrative Templates.
Search for the policy named 'Hard-delete the contents of an added folder when user loses permissions to the folder' and set it to Enabled.
Assign this configuration profile to the relevant user or device groups and save your changes.
Test the 'AddedFolderUnmountOnPermissionsLoss' Setting via Group Policy
You can deploy a Group Policy Object (GPO) or a registry script to enforce folder unmounting, though results in some environments can be inconsistent.
Try WPS Office for Secure and Lightweight Document Management
While managing complex administrative permissions and sync issues in SharePoint requires specific IT policies, everyday document creation should be simple. Consider WPS Office as a lightweight, fully compatible alternative for viewing, creating, and editing your documents without heavy synchronization overhead.
- 1. Download the Installer: Visit the official WPS website and download the free installation package for your operating system.
- 2. Install WPS Office: Run the downloaded installer and follow the on-screen prompts to complete the setup.
- 3. Start Creating: Open WPS Office and sign in to access free cloud storage and start working on your documents immediately.

Frequently Asked Questions
Why do synced SharePoint files remain on the local drive after permissions are removed?
By default, OneDrive leaves previously synced files on the local drive to prevent accidental data loss. While synchronization of new changes stops automatically, the local cached copies must be deleted manually unless a specific administrative policy (like hard-delete) is enforced.
Does unlinking the OneDrive account delete the local files?
No, unlinking an account from OneDrive only stops the connection between the cloud and the local workstation. Any files that were completely downloaded to the local drive will remain there until manually deleted.
Can end-users manually delete the SharePoint files after losing permissions?
Yes. Once permissions are revoked and the cloud connection is severed, users can manually delete the remaining local files from their file explorer. However, this relies on user compliance rather than automated IT security controls.




