Skip to content

No method match route template while trying to assign group to CompliancePolicy #3376

@PieterVerlooij

Description

@PieterVerlooij

Describe the bug

Hi!

I am trying to assign a device group to a compliance policy via the Graph SDK.
Either by

But all results in;

Image or Image

Expected behavior

I expect the group to be assigned to said compliance policy.

How to reproduce

  1. Create hash table with the group details for example"
    $assignmentParams = @{
    '@odata.type' = '#microsoft.graph.deviceCompliancePolicyAssignment'
    target = @{
    '@odata.type' = 'microsoft.graph.configurationManagerCollectionAssignmentTarget'
    collectionId = '22e09846-0b37-4b7b-adcc-8dd1d837515f_2de4a377-c833-4320-9957-64d2c567d7bb'
    }
    }
  2. Run Invoke-GraphRequest -Method post -Uri "https://graph.microsoft.com/v1.0//deviceManagement/deviceCompliancePolicies/11473e08-4211-4bd4-898f-d17052219531/assignments" or New-MgDeviceManagementDeviceCompliancePolicyAssignment -DeviceCompliancePolicyId '11473e08-4211-4bd4-898f-d17052219531' -BodyParameter $assignmentParams
  3. See results

SDK Version

2.29.1

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

Click to expand log ```
</details>


### Configuration

Name                           Value
----                           -----
PSVersion                      7.5.2
PSEdition                      Core
GitCommitId                    7.5.2
OS                             Microsoft Windows 10.0.22631
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Windows 11 x64

### Other information

_No response_

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:waiting-for-triageAn issue that is yet to be reviewed or assignedtype:bugA broken experience

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions