Forum Discussion
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
- rhoward610Copper Contributor
nsovilj Hi mate, did this ever get resolved?
I'm running into this issue myself using C# SDK and Graph API REST API. - Richard_DunnCopper ContributorThis is still a problem.
- AMCodyPCopper ContributorThis 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 - AMCodyPCopper ContributorI 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.