Graph and PowerShell Blog | About | Links
Graph Audit Log returns 403
22-Aug-24

Running the MG Graph command New-MgBetaSecurityAuditLogQuery returns an error 403.
The API permission is added and Search Parameters are setup:

$SearchParameters = @{
displayName = "Joe Soap"
filterStartDateTime = "2024-07-29T08:28:56Z"
filterEndDateTime = "2024-07-29T12:28:56Z"
recordTypeFilters = @("ExchangeItemAggregated")
operationFilters= @("MailItemsAccessed") }

When we run the command we get a 403 error:

New-MgBetaSecurityAuditLogQuery -BodyParameter $searchparameters

New-MgBetaSecurityAuditLogQuery_Create: {"message":"App:xxxxxx dont have any permissions"}

Currently, I don't have a fix for this issue.

References: MS Tech Community