Office 365 - Retrieve all sites a user has access to

Brass Contributor
What is the best way to retrieve all sites a user has access to in Office 365 using a script that runs outside Office 365 and how do we simulate user authentication ?

Can a solution be implemted using SharePoint search APIs or the Microsoft Graph ?
4 Replies
You don't need to simulate user authentication, just use a user with the required permissions to get for each user the sites he can access. I would recomend to use Search API for this requirement
The requirement is that a manger can see a report of the sites that his subordinate has access to.

Can you please shed some light on how to achieve this? How do we simulate the user executing the API query?
“use a user with the required permissions to get for each user the sites he can access.”
Azure AD app regustration has permissions that allow an app to Search as another user for O365 SharePoint Online.

Is there information somewhere on how to set this up?