Forum Discussion
Filter out Teams sharepoint sites
Hi everyone,
I'm currently working on a project where I need to filter out Teams SharePoint channel sites when making a request to retrieve all sites using the GET /sites endpoint.
I have noticed that there doesn't seem to be a specific parameter in the properties that can be used to identify Teams sites. For example, when working with OneDrive, the URL contains "-my.xxx.com" as an identifier. Is there any way to filter out Teams sites?
One possible approach I have considered is listing all the channel names in Teams and then filtering out the sites that match those names. I have observed that the SharePoint web client can perform this kind of filtering. Is this functionality only available internally and not accessible through the Graph API? When I access a Teams SharePoint site, it displays the Teams logo, and these sites are not visible under "All Sites" in the SharePoint client.
- Samraj_krishnakumarCopper ContributorHi Reporter,
Did you get anywork around for this? Now /sites/getAllSites endpoint also returning all the teams site as well.- ksaurabh02Copper Contributor
Samraj_krishnakumar Workaround is that, get all teams group name (ie. the teams sites name) with teams API. And then filter out the sites.
List all teams in Microsoft Teams for an organization - Microsoft Graph | Microsoft Learn