I want to know if there is any way I can get the entire list of My Sites (personal sites) with in the My Site collection for a tenant.
So I'm looking for all sites under
https://{tenantName}-my.sharepoint.com
site collection for a tenant. I have come across various answers saying I could do a search query on STS_Site but please not that I am using App Only Token and that doesn't work for App Only Access Token (i.e, for Client Credentials Flow)
Isn't there any other way through REST API that I can get this list?
https://{tenantName}-my.sharepoint.com/personal/abc_domain_com
https://{tenantName}-my.sharepoint.com/personal/pqr_domain_com
https://{tenantName}-my.sharepoint.com/personal/xyz_domain_com
...
I was hoping this would give me the sites under My Site Collection
https://{tenantName}-my.sharepoint.com/_api/web/webs
but I get the following
{
"d": {
"results": []
}
}
Much appreciated!
PS: I even tried Authorization Code Grant Flow to get the access token and did a search query for STS_Site content type, but it doesn't return me the entire list, just a subset! The user I made the search query with is the Global Admin so this info should be entirely available but it isn't. The Authorization Code Grant Flow is not of much use to me because of certain limitations(one of them is the visibility of sites like above and some others). So I am more interested in finding a solution using Client Credentials Flow (App Only Access Token)
Is there a way?
webs
.