How to get Microsoft 365 Planner 'All Plans' using Microsoft Graph

Mourtaza Moise Fazlehoussen 46 Reputation points MVP
2021-06-22T16:38:16.723+00:00

Hi folks,

We have got a requirement to list all Plans for all users along with their respective buckets within the organization.

I tried OAuth authorization services (AAD > App registrations) to access the planner APIs/resources using the Graph API Endpoint however I am getting access denied - It is important to mention here that the app has got all the privileges.

Does Microsoft allow to read all Planners data? provided the account has all the required permissions - if so then what am I missing here?

IGraphServiceGroupsCollectionPage groupCollection = await graphClient.Groups.Request().GetAsync();

                if (groupCollection?.Count > 0)
                {

                    foreach (Microsoft.Graph.Group group in groupCollection)
                    {
                        if (group is Microsoft.Graph.Group)
                        {
                            if (group != null && group.GroupTypes != null && group.GroupTypes.Count() > 0)
                            {
                                plansData = await GetPlanData(graphClient, plansData, group);
                                IPlannerGroupPlansCollectionPage plansCollection = await graphClient.Groups[group.Id].Planner.Plans.Request().GetAsync();
                            }
                        }
                    }
                }

Thanks in advance.

Microsoft Graph Users API
Microsoft Graph Users API
A Microsoft API that allows you to build compelling app experiences based on users, their relationships with other users and groups, and the resources they access for example their mails, calendars, files, administrative roles, group memberships.
637 questions
Microsoft Graph Groups API
Microsoft Graph Groups API
A Microsoft API that creates and manages different types of groups and group functionality.
189 questions
No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Fazlehoussen, Mourtaza - bhn 21 Reputation points
    2021-06-28T12:40:35.497+00:00

    The workaround is to use a delegated (permission type) access token for the tenant admin (on Graph API): Loop through the groups For each group, add the admin as a member if needed Read Planner data Remove admin from members.

    Reference: https://stackoverflow.com/questions/68087874/how-to-get-microsoft-365-planner-all-plans-for-all-users-using-microsoft-graph