How to Hide the Files Tab in Microsoft Teams with PowerShell
Introduction
By default, every Microsoft Teams channel includes a Files
tab, which provides access to SharePoint and OneDrive storage. While you can’t rename the Files
tab (see my post here), you can control its visibility using Teams Files Channel Policy settings.
In this post, I’ll demonstrate how to use PowerShell to hide or show the Files tab in Teams channels by configuring the SPChannelFilesTab
and NativeFileEntryPoints
policy settings.
Background
Tony Redmond’s article, Teams Native Files Policy Disables SharePoint and OneDrive Access, explains how these policy settings work:
- NativeFileEntryPoints: (Default: Enabled)
If disabled, Teams removes the options to upload files from OneDrive for Business, other cloud storage services, and SharePoint Online (Teams and channels). - SPChannelFilesTab: (Default: Enabled)
If disabled, users do not see the Teams Files channel tab in any channel or chat. However, Teams still configures SharePoint sites for new teams and folders for new channels.
However disabling NativeFileEntryPoints is enough to hide the files
tab and prevent any file attachments within posts
.
Reviewing Teams Files Policies
First, connect to Microsoft Teams and review existing file policies:
Connect-MicrosoftTeams
Get-CsTeamsFilesPolicy
Creating a Custom Teams Files Policy
To create a policy that hides the Files tab and disables native file entry points:
New-CsTeamsFilesPolicy -Identity NoSPOFilesTab -SPChannelFilesTab Disabled -NativeFileEntryPoints Disabled
Grant-CsTeamsFilesPolicy -Identity user@domain.com -PolicyName NoSPOFilesTab
Policy Settings and Their Effects
SPChannelFilesTab | NativeFileEntryPoints | Outcome |
---|---|---|
Disabled | Enabled | Files Tab visible and users can attach files.![]() |
Enabled | Disabled | Files Tab not visible and users cannot attach files.![]() |
Updating Teams Policy Examples
Enable Native File Entry (Files Tab Visible):
Set-CsTeamsFilesPolicy -Identity NoSPOFilesTab -SPChannelFilesTab Disabled -NativeFileEntryPoints Enabled
Result: The Files tab becomes visible again.
Disable Native File Entry and Enable Channel Files Tab (Files Tab Hidden):
Set-CsTeamsFilesPolicy -Identity NoSPOFilesTab -SPChannelFilesTab Enabled -NativeFileEntryPoints Disabled
Result: The Files tab is hidden and users cannot attach files.
Remove Teams Policy template
To remove the policy from all users assigned to the Teams Files policy, use cmdlet Remove-CsTeamsFilesPolicy
.
Remove-CsTeamsFilesPolicy -Identity NoSPOFilesTab
However I got the error message unable to remove it because I assigned it to a group of users which I was unable to unassign.
Remove-CsTeamsFilesPolicy: The policy “NoSPOFilesTab” is currently assigned to one or more users or groups. Ensure policy is not assigned before removing. Please refer to documentation. CorrelationId: 240cce12-feb5-4dc9-97b5-cb5a3be7d64e
Hide Teams Tab
Remove-PnPTeamsTab -Team "Retail" -Channel "General" -Identity "Notes" -force
Files
and Posts
can’t be hidden
Hide Files
tab
Remove-PnPTeamsTab -Team "MSFT" -Channel "General" -Identity "Files" -force
Remove-PnPTeamsTab: Call to Microsoft Graph URL https://graph.microsoft.com/v1.0/teams/de30c06c-2477-4f8d-876f-b3ec8b4f4695/channels/19:mAv7dH-uSMARWWaWozh9otsLoSugXTxxs3Ml7u0Hvo81@thread.tacv2/tabs/3ed5b337-c2c9-4d5d-b7b4-84ff09a8fc1c failed with status code Forbidden: Delete operation is not allowed on a permanent tab (tabId: 3ed5b337-c2c9-4d5d-b7b4-84ff09a8fc1c)
Hide Posts
tab
Remove-PnPTeamsTab -Team "MSFT" -Channel "General" -Identity "Posts" -force
Remove-PnPTeamsTab: Tab not found
Conclusion
While you can’t rename the Files tab in Teams, you can control its visibility and file upload options using Teams Files Policies. Adjusting the SPChannelFilesTab
and NativeFileEntryPoints
settings allows you to tailor the Teams experience to your organization’s needs.