Microsoft Graph API PATCH Error When Updating Antivirus Exclusions in MDE via PowerShell (Update-MgBetaDeviceManagementConfigurationPolicySetting)

Nikolaos Bazotis 0 Reputation points
2025-04-07T12:57:15.54+00:00

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.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,488 questions
0 comments No comments
{count} votes

Your answer

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