How to fix 403 Forbidden: Microsoft Graph API

Drew Burgess 0 Reputation points
2024-07-30T17:14:34.5+00:00

Hello,

In the attached image you'll see a request I made to get an Intune device configuration policy, I followed all the documentation on Microsoft's website. I created an app in Azure and giving it the correct permissions to reach the Graph API, as a Global Administrator I was able to approve those permissions for the application and the Graph API. I then made sure the Graph environment variable was update with the correct app authentication information. Yet still I receive the 403 Forbidden error and I cannot figure out why. Any help would be very appreciated.

Graph_Api_Error.DeviceManagementApps.ReadWrite.All

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2024-07-31T03:02:26.2133333+00:00

    Hi @Drew Burgess

    According to the error message on the picture you provide, the error is due to the lack of DeviceManagementConfiguration.Read.All or DeviceManagementConfiguration.ReadWrite.All permissions, Please try the following code:

    Connect-MgGraph -Scopes "DeviceManagementConfiguration.Read.All"
    

    More details can be found at this link:

    https://github.com/microsoftgraph/msgraph-sdk-powershell

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.