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

%3CLINGO-SUB%20id%3D%22lingo-sub-2277396%22%20slang%3D%22en-US%22%3ERetrieve%20all%20site%20collections%20names%20(O365%20SharePoint)where%20user%20belong%20to.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2277396%22%20slang%3D%22en-US%22%3E%3CP%3EWould%20like%20to%20retrieve%20(Tenant)%20All%20Site%20collections%20names%20where%20user%20belongs%20to%20(except%20everyone%20group).%3CBR%20%2F%3EI%20tried%20with%20SharePoint%20Search%20Api%20(%2F_layouts%2F15%2Fsearch.aspx%2Fsites%3Fp%3D1%26amp%3Bq%3DSharePoint)%20but%20I%20haven't%20succeeded.%3CBR%20%2F%3EAlso%2C%20I%20tried%20with%20Graph%20Api%20approach.%20but%20no%20direct%20api%20is%20available.%3CBR%20%2F%3EHighly%20appreciated%20your%20ideas%20%2F%20suggestion%20to%20achieve%20this%20use%20case.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2277396%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2279038%22%20slang%3D%22en-US%22%3ERe%3A%20Retrieve%20all%20site%20collections%20names%20(O365%20SharePoint)where%20user%20belong%20to.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2279038%22%20slang%3D%22en-US%22%3EYou're%20best%20bet%20would%20be%20to%20use%20PnPOnline%20or%20possible%20M365Cli%20to%20loop%20through%20the%20sites%20and%20process%20members%20looking%20to%20match%20your%20user%3C%2FLINGO-BODY%3E
Occasional 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