Controlling settings, permissions, and membership within Teams and channels
Hello @Huynh Tran Trung Hieu,
Thank you for your question and for sharing the error message.
Based on the current design of Microsoft Teams and SharePoint Online, this behavior is expected and by design, rather than something caused by a missing configuration.
In Microsoft Teams, each team is connected to a Microsoft 365 group where membership is managed centrally. Files that you see in the Files tab of a team are stored in SharePoint. For standard channels, all channels share the same SharePoint site. However, for private and shared channels, Teams automatically creates a separate SharePoint site for each channel to ensure that access is strictly limited to the channel’s members.
Because these private and shared channel sites are tightly managed by Microsoft Teams, certain SharePoint administrative actions are intentionally restricted to avoid breaking the Teams experience or causing access inconsistencies. One of those restrictions is that private and shared channel sites cannot be locked or set to ReadOnly/NoAccess using the LockState property. This is why the PowerShell command returns the message that these sites are not allowed to be locked.
At the moment, there is no official Microsoft article that directly calls out the LockState limitation specifically for private or shared channel sites. However, you may find it helpful to review the following documentation, which explains how Teams‑connected SharePoint sites are structured and managed: Teams and SharePoint integration - SharePoint in Microsoft 365 | Microsoft Learn
This article provides useful background on how Teams and SharePoint work together and helps explain why some SharePoint site controls behave differently for Teams channel sites.
I hope this helps clarify the behavior. Please feel free to let me know if you have further questions
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread