Need to use Graph API to get SharePoint site owners in Power Automate. Able to achieve it through REST API but not finding Graph API to fetch the SharePoint owners of the site.
Can you guide?
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.
Sign up to join this communityIf your SharePoint online site is connected to the Microsoft 365 group, it will be easier to fetch the owners using Microsoft graph API endpoints.
You can get the M365 group owners for the group associated with your SharePoint team site using List group owners endpoint like:
GET /groups/{id}/owners
Example Response:
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#directoryObjects",
"value": [
{
"@odata.type": "#microsoft.graph.user",
"id": "4562bcc8-c436-4f95-b7c0-4f8ce89dca5e",
"accountEnabled": true,
"displayName": "MOD Administrator",
"userPrincipalName": "[email protected]"
},
{
"@odata.type": "#microsoft.graph.user",
"id": "f0206b06-7c5d-461c-ae24-08f68b7ef463",
"accountEnabled": true,
"displayName": "Megan Bowen",
"userPrincipalName": "[email protected]"
},
{
"@odata.type": "#microsoft.graph.user",
"id": "5c70937c-d9ea-4a47-8852-ab77630f803d",
"accountEnabled": true,
"displayName": "Diego Siciliani",
"userPrincipalName": "[email protected]"
}
]
}
Documentation: List group owners
Currently, Site resource does not expose Owner property.
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 an owner property in the response:
https://graph.microsoft.com/v1.0/sites/{site-id}/drive
Hope this helps. Best Wishes.
https://graph.microsoft.com/v1.0/sites?search=YourSiteName
. 2) Get ownershttps://graph.microsoft.com/v1.0/sites/<<LOONG,ID,HERE>>/drive