Verify all the SharePoint sites that belong to Microsoft Teams Private Channels

When creating a Microsoft Teams private channel by default, it creates a brand new SharePoint site which will store all the information related to that private channel. This is a special site that contains a couple of settings. I will leave at reference an article that you can check to check those settings. I will share some PnP PowerShell commands that will help us to get this information.

Verify that you’ve PnP PowerShell on your machine and you’ve access to a SharePoint admin account before running this command. This will create a CSV file with all the site that match the criteria. All the private channel site will have a template type of TEAMCHANNEL#0.

Connect-PnPOnline -Url https://contoso-admin.sharepoint.com/ -PnPManagementShell
Get-PnPTenantSite -Template "TEAMCHANNEL#0" | Export-Csv -Path '.\sites.csv'

When this command is completed, you should have your laptop a CSV file that will contain those sites. This CSV file will contain a lot of information that you may not need so you can adjust that to your needs. From here you can then understand if for example these sites are still being used or if they should be prevented to be created in the first place.

Reference

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *