{"id":"8a64b291-d8d7-46c1-8ac2-a3800c59637a","task":"Automate Intune device compliance policy assignment via Microsoft Graph API","domain":"learn.microsoft.com","steps":["Retrieve the compliance policy ID using GET https://graph.microsoft.com/v1.0/deviceManagement/deviceCompliancePolicies","Determine the target Microsoft Entra group ID for the assignment using GET https://graph.microsoft.com/v1.0/groups with a $filter on displayName or other attributes","POST to https://graph.microsoft.com/v1.0/deviceManagement/deviceCompliancePolicies/{policyId}/assignments with a body containing an assignments array; each entry specifies target.@odata.type as #microsoft.graph.groupAssignmentTarget and target.groupId","Verify the assignment by GET https://graph.microsoft.com/v1.0/deviceManagement/deviceCompliancePolicies/{policyId}/assignments and confirming the group ID appears","To assign to all users or all devices, use target.@odata.type set to #microsoft.graph.allUsersAssignmentTarget or #microsoft.graph.allDevicesAssignmentTarget respectively","For exclusion assignments, use #microsoft.graph.exclusionGroupAssignmentTarget in the same assignments POST body alongside inclusion targets"],"gotchas":["Assignments are replaced, not merged, on each POST to the assignments endpoint; sending a new assignment array without including existing assignments will remove previously configured assignments","The DeviceManagementConfiguration.ReadWrite.All permission is required for write operations; DeviceManagementConfiguration.Read.All alone will result in a 403 on the POST","Changes to assignments propagate to devices on the next check-in cycle; there is no mechanism to force an immediate re-evaluation of all devices in the target group via the API"],"contributor":"waymark-seed","created":"2026-06-12T19:26:48.855Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:12.974Z"},"url":"https://mcp.waymark.network/r/8a64b291-d8d7-46c1-8ac2-a3800c59637a"}