No Good Way to Clean up Unwanted ex-Teams Channel Folders
Some years ago, I wrote about why Teams leaves the SharePoint folder intact when it deletes a channel. In a nutshell, this is to avoid data loss. The deletion of a channel can be reversed for up to 21 days afterward, and it’s important to be able to restore the complete channel including its files in the Teams channel folder during the 21-day retention period.
But then the question of what happens after the retention period arises. The channel is gone and irrecoverable, but its folder lingers on in SharePoint as a reminder of a now-gone collaborative space. The natural thing for administrators is to clean up the unwanted folder, but that’s not possible because the Delete option is missing from the folder menu. Figure 1 shows an example. There’s no Delete or Move to options in the menu for a folder connected to a Teams channel.
In a Microsoft technical community discussion, some suggest using the Move to option to move the complete folder to somewhere else, like a personal OneDrive account, and delete it from there. Others put their faith in the Move-PnPFolder cmdlet, and some other innovative solutions are offered.
The point is that administrators want to remove the unwanted folders belonging to deleted channels and don’t understand why Teams makes this difficult to do.
Teams Takes Control
After playing around with several channel deletion scenarios in my tenant, it seems to me that when Teams creates a channel folder, it updates the folder properties to remove the options to delete and move the folder. This wasn’t always the case. An unpublicized change seems to have made the change sometime late in 2019. I’ve been able to delete folders belonging to old channels, even immediately after deleting the channel in Teams by following the same approach as used to delete SharePoint folders that have no relationship with Teams:
- Removing all subfolders (delete or move the items).
- Deleting the channel folder.
An example is in Figure 2. In this case, the deletion was of a channel created in November 2016, which is right at the start of the Teams era. The connection with SharePoint Online was looser and this is probably what allowed the deletion to happen. You can see that the menu for this folder includes both Delete and Move to options.
As time went by, Teams became more proscriptive in how it dealt with SharePoint Online. For instance, you can’t modify the settings of the sites used for Teams shared and private channels because Teams will overwrite what you do with settings from the host team.
But I think the reason why Teams doesn’t allow site administrators to delete these folders is to avoid the possibility of data loss both during normal operation and while a deleted channel is in a soft-deleted and restorable state. Removing the Delete option stops an accident happening that leads to data loss and removing the Move to option prevents someone moving files that might be required to restore a deleted channel.
Break the Connection with Teams
What’s missing is a step in the code Teams uses to permanently remove a deleted channel. When the 21-day retention period lapses, Teams cleans up by removing the channel from its soft-deleted cache. It would be good if it also reset the properties of the channel folder to break any connection to Teams and to allow site administrators to manage the folder as normal. In other words, restore the Delete and Move to options in the folder menu and stop telling people they must manage the folder through Teams.
I don’t mind Teams wanting to keep its channel folders under control, but there’s a time to let go, and it’s obvious that Teams hangs on too long in this instance.
Learn how to exploit the data available to Microsoft 365 tenant administrators through the Office 365 for IT Pros eBook. We love figuring out how things work.