MS Graph API Intune error 403 with windowsMalwareInformation

Laurent MERIAU 1 Reputation point
2021-11-09T09:07:33.027+00:00

Hello,

I try to get information from Intune Graph API about windowsMalwareInformation as described here : https://learn.microsoft.com/en-us/graph/api/intune-devices-windowsmalwareinformation-get?view=graph-rest-beta
I have created an application with correct permissions :

147706-registredapp.png

When i query Graph Api, I receive error 403 Forbidden :
147751-forbidden.png

Note : token is generated with this method :

$tokenBody = @{    
    Grant_Type    = "client_credentials"    
    Scope         = "https://graph.microsoft.com/.default"    
    Client_Id     = $clientId    
    Client_Secret = $clientSecret    
}     
  
$tokenResponse = Invoke-RestMethod -Uri "https://login.microsoftonline.com/$Tenantid/oauth2/v2.0/token" -Method POST -Body $tokenBody  

Did I forget something?

Thanks you for help.

Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
4,317 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Laurent MERIAU 1 Reputation point
    2021-11-15T16:23:01.01+00:00

    Hi @Lu Dai-MSFT , thanks for your answser, but that does not solve my issue.

    When I use this Url "https://graph.microsoft.com/beta/deviceManagement/managedDevices", I can sucessfully request Graph API.

    Same App (and permission) and same code is used.