Microsoft Graph API PATCH Error When Updating Antivirus Exclusions in MDE via PowerShell (Update-MgBetaDeviceManagementConfigurationPolicySetting)
I’m currently working on managing antivirus policy exclusions in Microsoft Defender for Endpoint (MDE) using PowerShell and the Microsoft Graph API.
While I’m able to successfully retrieve the relevant policies and their current settings, I’m running into issues when trying to apply updates—specifically when modifying the exclusion list.
I’ve tried using both Update-MgBetaDeviceManagementConfigurationPolicySetting
and a direct PATCH
request to: https://graph.microsoft.com/beta/deviceManagement/configurationPolicies/$policyId/settings/$($setting.id)
However, I receive the following error:
No OData route exists that matches template ~/singleton/navigation/key/navigation/key with HTTP verb PATCH for request /DeviceConfigV2/DCV2GraphService/xxxx/deviceManagement/configurationPolicies('xxxx')/settings('x)
I've reviewed the available documentation, but I haven’t been able to find a working request body template or clear guidance on how to properly structure the PATCH request for this endpoint.
Any insights or working examples would be greatly appreciated.