Forum Discussion

nsovilj's avatar
nsovilj
Copper Contributor
Jun 01, 2023

Intune Device Compliance policy assignment POST - No OData route exists

I have created a compliance policy via Graph API but another command, New-MgDeviceManagementDeviceCompliancePolicyAssignment, is needed to assign a group to that compliance policy. I have found ID of "All Users" older compliance policy has assigned via Get-MgDeviceManagementDeviceCompliancePolicyAssignment and used that same ID of the group but I got the following error:

 

New-MgDeviceManagementDeviceCompliancePolicyAssignment_CreateExpanded: No OData route exists that match template ~/singleton/navigation/key/navigation with http verb POST for request /DeviceConfiguration_2305/StatelessDeviceConfigurationFEService/deviceManagement/deviceCompliancePolicies('67a65edf-8f06-4f36-9e75-be894ea58f30')/assignments.

 

I have tried to do the same thing via Graph Explorer since I thought maybe the PowerShell Graph has a bug but still I get the same error, also on v1.0 and beta

4 Replies

  • rhoward610's avatar
    rhoward610
    Copper Contributor

    nsovilj Hi mate, did this ever get resolved?

    I'm running into this issue myself using C# SDK and Graph API REST API.

  • AMCodyP's avatar
    AMCodyP
    Copper Contributor
    This is the code that I'm using:

    $body = [Microsoft.Graph.PowerShell.Models.IMicrosoftGraphDeviceManagementConfigurationPolicyAssignment] @{
    Target = @{
    'groupId' = $Group.Id
    '@odata.type' = '#microsoft.graph.groupAssignmentTarget'
    }
    }
    New-MgDeviceManagementDeviceConfigurationAssignment -DeviceConfigurationId $Group.Id -BodyParameter @body
  • AMCodyP's avatar
    AMCodyP
    Copper Contributor
    I have the exact same issue - did you ever solve this? If not, I'll do some more digging and try to report it to the relevant MS team.

Resources