Get List of All SharePoint Sites (/Teams and /sites) where user has permission in Office 365

laxman 1 Reputation point

Dear Community ,

We have 50000 Sites in my Tenant, would like to read all site collections /sub sites information where user is a member of.

we are looking API Based solutions.

We implemented the same use case in 2013 with search api but in Online it’s not working. Also, we checked Rest and Graph api options, but couldn't find any best solution.

Highly appreciate your suggestions or help.

A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,183 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MichaelHan-MSFT 18,001 Reputation points

    Hi @laxman ,

    With Graph api, you can only get the groups that the user is a memeber of:

    For Rest api, the scope is site, so you can only get the information of one site.

    The best way is using search api, sign in as that user, _api/search/query?querytext='contentclass:STS_Site contentclass:STS_Web' .The user would get a list of the site he could access to.

    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.