Question: Get Calendar Events of all group members via Power Automate

I want to get the Calendar Events of all of the members in the organization/team via Power Automate. As I see now the "Get Calendars (V2)" and the "Get Calendar View of Events (V3)" only return the corresponding values of the user itself (the one who owns the flow). I was wondering if there's a way to get the calendar events of the group members given the fact that they've given the corresponding permission to share all the calendar data with the organization members.
Any help on this will be much appreciated.
Thanks!


Answer:
The built-in connector will use the current user.
I don't think you can impersonate a user this way.
The best approach or alternative is to use Graph API with a servcie account (Azure AD app registration). You can get events from anyone, so from each users part of a group.
GET /users/{id | userPrincipalName}/calendar/events

GET /groups/{id}/members

To call Graph API with Power Automate you will need HTTP connector (it's a premium connector and the connector must be enable for your environment)
You have to declare a service account in Azure AD (or Microsoft Entra):

Create a new app registration (Applications > App registrations)

Copy the client id
Copy the tenant id





Add the following permissions (Applications > App registrations > API permissions)

Graph API > Application > Calendars.Read.All
Graph API > Application > Directory.Read.All
Graph API > Application > GroupMember.Read.All


Grant admin consent for the permissions



Generate a client secret (Applications > App registrations > Certificate & secrets > Client secrets)

In Power Automate, create a new cloud flow, for example a button with the group id as input.
Declare variables:

Client ID on the app registration
Client secret for the app registration
Tenant ID
Array to store all the events


Next, call Graph API to get group members with the generic HTTP connector
Method: GET
URI: https://graph.microsoft.com/v1.0/groups/<your group id input>/members
Headers: Content-Type application/json
Headers: Accept application/json
Authentication: Active Directory OAuth
Tenant: your tenant id variable
Audience: https://graph.microsoft.com
Client ID: your client id variable
Crendential Type: Secret
Secret: your client secret variable


Transform the result in JSON using the schema:
{
"type": "object",
"properties": {
    "@@odata.context": {
        "type": "string"
    },
    "value": {
        "type": "array",
        "items": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "mail": {
                    "type": "string"
                }
            },
            "required": [
                "id",
                "mail"
            ]
        }
    }
}
}

For each members, call Graph API to get user's events
Method: GET
URI: https://graph.microsoft.com/v1.0/users/<user id fron json foreach>/event
Headers: Content-Type application/json
Headers: Accept application/json
Authentication: Active Directory OAuth
Tenant: your tenant id variable
Audience: https://graph.microsoft.com
Client ID: your client id variable
Crendential Type: Secret
Secret: your client secret variable


Transform the result in JSON using the schema:
{
"type": "object",
"properties": {
    "@@odata.context": {
        "type": "string"
    },
    "value": {
        "type": "array",
        "items": {
            "type": "object",
            "properties": {
                "@@odata.etag": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "createdDateTime": {
                    "type": "string"
                },
                "lastModifiedDateTime": {
                    "type": "string"
                },
                "changeKey": {
                    "type": "string"
                },
                "categories": {
                    "type": "array"
                },
                "transactionId": {
                    "type": "string"
                },
                "originalStartTimeZone": {
                    "type": "string"
                },
                "originalEndTimeZone": {
                    "type": "string"
                },
                "iCalUId": {
                    "type": "string"
                },
                "reminderMinutesBeforeStart": {
                    "type": "integer"
                },
                "isReminderOn": {
                    "type": "boolean"
                },
                "hasAttachments": {
                    "type": "boolean"
                },
                "subject": {
                    "type": "string"
                },
                "bodyPreview": {
                    "type": "string"
                },
                "importance": {
                    "type": "string"
                },
                "sensitivity": {
                    "type": "string"
                },
                "isAllDay": {
                    "type": "boolean"
                },
                "isCancelled": {
                    "type": "boolean"
                },
                "isOrganizer": {
                    "type": "boolean"
                },
                "responseRequested": {
                    "type": "boolean"
                },
                "seriesMasterId": {},
                "showAs": {
                    "type": "string"
                },
                "type": {
                    "type": "string"
                },
                "webLink": {
                    "type": "string"
                },
                "onlineMeetingUrl": {},
                "isOnlineMeeting": {
                    "type": "boolean"
                },
                "onlineMeetingProvider": {
                    "type": "string"
                },
                "allowNewTimeProposals": {
                    "type": "boolean"
                },
                "occurrenceId": {},
                "isDraft": {
                    "type": "boolean"
                },
                "hideAttendees": {
                    "type": "boolean"
                },
                "responseStatus": {
                    "type": "object",
                    "properties": {
                        "response": {
                            "type": "string"
                        },
                        "time": {
                            "type": "string"
                        }
                    }
                },
                "body": {
                    "type": "object",
                    "properties": {
                        "contentType": {
                            "type": "string"
                        },
                        "content": {
                            "type": "string"
                        }
                    }
                },
                "start": {
                    "type": "object",
                    "properties": {
                        "dateTime": {
                            "type": "string"
                        },
                        "timeZone": {
                            "type": "string"
                        }
                    }
                },
                "end": {
                    "type": "object",
                    "properties": {
                        "dateTime": {
                            "type": "string"
                        },
                        "timeZone": {
                            "type": "string"
                        }
                    }
                },
                "location": {
                    "type": "object",
                    "properties": {
                        "displayName": {
                            "type": "string"
                        },
                        "locationType": {
                            "type": "string"
                        },
                        "uniqueIdType": {
                            "type": "string"
                        },
                        "address": {
                            "type": "object",
                            "properties": {}
                        },
                        "coordinates": {
                            "type": "object",
                            "properties": {}
                        }
                    }
                },
                "locations": {
                    "type": "array"
                },
                "recurrence": {},
                "attendees": {
                    "type": "array"
                },
                "organizer": {
                    "type": "object",
                    "properties": {
                        "emailAddress": {
                            "type": "object",
                            "properties": {
                                "name": {
                                    "type": "string"
                                },
                                "address": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                },
                "onlineMeeting": {},
                "calendar@odata.associationLink": {
                    "type": "string"
                },
                "calendar@odata.navigationLink": {
                    "type": "string"
                }
            },
            "required": [
                "@@odata.etag",
                "id",
                "createdDateTime",
                "lastModifiedDateTime",
                "changeKey",
                "categories",
                "transactionId",
                "originalStartTimeZone",
                "originalEndTimeZone",
                "iCalUId",
                "reminderMinutesBeforeStart",
                "isReminderOn",
                "hasAttachments",
                "subject",
                "bodyPreview",
                "importance",
                "sensitivity",
                "isAllDay",
                "isCancelled",
                "isOrganizer",
                "responseRequested",
                "seriesMasterId",
                "showAs",
                "type",
                "webLink",
                "onlineMeetingUrl",
                "isOnlineMeeting",
                "onlineMeetingProvider",
                "allowNewTimeProposals",
                "occurrenceId",
                "isDraft",
                "hideAttendees",
                "responseStatus",
                "body",
                "start",
                "end",
                "location",
                "locations",
                "recurrence",
                "attendees",
                "organizer",
                "onlineMeeting",
                "calendar@odata.associationLink",
                "calendar@odata.navigationLink"
            ]
        }
    }
}
}


Activate and start the flow with a group id as input: