Can OneDrive Be Set to Read-Only Except for Specific Folders?
Question details
The user wants to know if it is possible to apply a read-only lock to a OneDrive site while excluding specific folders, such as Teams chat archives and meeting recordings, so they remain writable.

- Product
- Microsoft OneDrive and SharePoint
- Device & OS
- not provided
- Scenario
- Administering site-level access and folder restrictions using the Set-SPOSite PowerShell command.
- Observed behavior
- Setting the OneDrive site to ReadOnly universally restricts all folders, including Teams-related folders, with no apparent way to exclude specific directories from the lock.
Ensure you have SharePoint Administrator privileges to run Set-SPOSite commands and carefully review your current folder permission structures before applying any site-wide locks.
Understand the Limitations of Site-Level ReadOnly Locks
Site-level read-only locks apply universally and cannot exclude individual folders from being locked.
When you use the Set-SPOSite command to set a OneDrive site's LockState to ReadOnly, the restriction is applied universally at the site level. This means it affects all content within that site, including interconnected Microsoft Teams folders like chat archives and meeting recordings.
Currently, there is no supported PowerShell command or built-in SharePoint method to exclude specific folders from this site-level lock state. The architecture requires that if a site is marked as read-only, all underlying document libraries and folders inherit this state.
Use the Get-SPOSite PowerShell command to verify the current LockState of the targeted OneDrive site before attempting to modify it.
If you require certain folders to remain actively writable while others are locked, you must avoid using the site-level ReadOnly lock and instead rely on item-level or folder-level permissions.

Workaround: Adjust Folder-Level Permissions Instead
Instead of locking the entire OneDrive site, manually restrict permissions on individual folders to achieve a similar result.
Boost Your Productivity with WPS Office
While managing complex cloud permissions in Microsoft OneDrive and SharePoint, you can streamline your daily document editing with WPS Office. It is a highly compatible, free, and lightweight alternative to Microsoft Office that easily handles your local and cloud-based files.
- 1. Download the installer: Visit the official WPS Office website to download the free installation package for your operating system.
- 2. Install and launch: Follow the on-screen instructions to install the software, then open the WPS Office application.
- 3. Open your documents: Click 'Open' to browse your local drive or synced cloud folders, and start editing your documents immediately.

Frequently Asked Questions
Why do Teams chat archives lock when I set my OneDrive to read-only?
Teams chat archives and meeting recordings are automatically stored in specific folders within a user's OneDrive. Because a site-level read-only lock applies universally to the entire OneDrive environment, these Teams folders are locked alongside everything else.
Can I use PnP PowerShell to exclude folders from a SharePoint site lock?
No. There is currently no supported PnP PowerShell command or parameter that allows administrators to exclude specific folders or document libraries when applying a site-level ReadOnly lock.
How can I make most of my OneDrive read-only but keep a few folders editable?
You cannot achieve this using the site-level LockState. Instead, you must keep the site unlocked and manually manage permissions at the folder level by stopping permission inheritance and assigning 'Read' access to the folders you want to lock.




