question

PabloGlomby-5415 avatar image
0 Votes"
PabloGlomby-5415 asked $$ANON_USER$$ commented

Check if a given SharePoint site belongs to Teams (SharePoint REST API, or CSOM)

Hi!
I cannot use Microsoft Graph (else it would be easy) because I cannot get the Graph Token (I use the SharePointOnlineCredentials with username/password).
So all I can use is CSOM and the REST API.

Right now I get the frequent sites using this REST API:
https://<your_tenant>/_vti_bin/homeapi.ashx/sites/recent?SPHome-ClientType=SharePointIOS&mostRecentFirst=true&start=0&count=100

It returns the recent sharepoint sites including those belonging to Teams. I need to know if a given site belongs to Teams or not.
I have read that using the WebTemplate value would be enough (if it is Group) but I discovered that I can manually create a SP site and it can hold this value.

Is there a reliable way to know if a given site is used in Teams?
Thanks

office-sharepoint-onlineoffice-teams-app-devoffice-sharepoint-server-development
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @PabloGlomby-5415,

Is there any update? If my answer helps you, you could accept it as answer, it will be helpful to others who have similar issues in the future.

0 Votes 0 ·

able to resolve it ? I am looking for the same solution

0 Votes 0 ·
trevorseward avatar image
0 Votes"
trevorseward answered

Using a username and password is considered insecure and you should switch to Client ID + Certificate or less preferably, Secret. The Graph API is how you need to pull this info.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MichaelHan-MSFT avatar image
0 Votes"
MichaelHan-MSFT answered $$ANON_USER$$ commented

Hi @PabloGlomby-5415,

Using SharePoint Rest Api or CSOM, we cannot check if the site is used in Teams. As you said, we can only get the WebTemplate value. But that's not enough.

As far as I know, when a site is used in Teams, the assosiated M365 group will have Teams connected. You can identify go to admin center> Groups>there you can see Teams status and symbol to identify that SharePoint site is used in Microsoft Teams. See image below for your reference.

79026-image.png



If an Answer is helpful, please click "Accept Answer" and upvote it.
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.



image.png (34.8 KiB)
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks,
In the Admin Center I cannot find that "group" option. Where can I exactly find this view?
Is there a programmatic way to know this "Team status"?

Thanks again

0 Votes 0 ·

Hi @PabloGlomby-5415,

It's in M365 admin center instead of SharePoint center.
79415-image.png


In a programmatic way, maybe you could use powershell to know the "Team status"

0 Votes 0 ·
image.png (9.7 KiB)
$$ANON_USER$$ avatar image $$ANON_USER$$ MichaelHan-MSFT ·

able to resolve it ? I am looking for the same solution

0 Votes 0 ·