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.
How to get Microsoft 365 Planner 'All Plans' using Microsoft Graph
Mourtaza Moise Fazlehoussen
46
Reputation points MVP
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.