Retrieve all site collections names (O365 SharePoint)where user belong to.

Brass Contributor

Would like to retrieve (Tenant) All Site collections names where user belongs to (except everyone group).
I tried with SharePoint Search Api (/_layouts/15/search.aspx/sites?p=1&q=SharePoint) but I haven't succeeded.
Also, I tried with Graph Api approach. but no direct api is available.
Highly appreciated your ideas / suggestion to achieve this use case.

 

 

 

1 Reply
You're best bet would be to use PnPOnline or possible M365Cli to loop through the sites and process members looking to match your user