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
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,321 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Fazlehoussen, Mourtaza - bhn 26 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

    0 comments No comments