MS Graph API Intune error 403 with windowsMalwareInformation

Anonymous
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 Security | Intune | Other
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    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.


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.