How to get the owner of a SharePoint site via Graph API

Kelly 81 Reputation points
2021-11-21T14:10:10.277+00:00

I am trying to get a sharepoint site with Graph API by referring to this doucmentation: https://learn.microsoft.com/en-us/graph/api/site-get?view=graph-rest-1.0&tabs=http.
But I can not get the site owner, can this be done by graph api?
Thanks in advance!
Kelly

Microsoft 365 and Office | SharePoint | Development
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. MichaelHan-MSFT 18,126 Reputation points
    2021-11-22T02:01:59.663+00:00

    Hi @Kelly ,

    Per my test, I could get the same result as yours on my end.

    Currently, Site resource does not expose Owner property. You could submit the request feature here: https://techcommunity.microsoft.com/t5/microsoft-365-developer-platform/idb-p/Microsoft365DeveloperPlatform

    As a workaround, you could get the default library owner in the site. The default library owner would be the site owner. Below is the endpoint to get the sites drive, there is a owner property in the response:

    https://graph.microsoft.com/v1.0/sites/{site-id}/drive  
    

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    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.


    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Stefank 46 Reputation points
    2022-01-19T23:12:45.943+00:00

    Hi @MichaelHan-MSFT ,

    is there any option to get not only the owner but the members of a site, too? I need to find out if a site has external members and if so who they are.

    Thanks!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.