question

MourtazaMoiseFazlehoussen-0263 avatar image
0 Votes"
MourtazaMoiseFazlehoussen-0263 asked saldana-msft edited

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

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-usersmicrosoft-graph-groups
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

FazlehoussenMourtazabhn-6864 avatar image
0 Votes"
FazlehoussenMourtazabhn-6864 answered

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

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.