-
Notifications
You must be signed in to change notification settings - Fork 211
Open
Labels
status:waiting-for-triageAn issue that is yet to be reviewed or assignedAn issue that is yet to be reviewed or assignedtype:bugA broken experienceA broken experience
Description
Describe the bug
Hi!
I am trying to assign a device group to a compliance policy via the Graph SDK.
Either by
- New-MgBetaDeviceManagementDeviceCompliancePolicyAssignment
- New-MgDeviceManagementDeviceCompliancePolicyAssignment
- Invoke-GraphRequest -Method post -Uri "https://graph.microsoft.com/v1.0//deviceManagement/deviceCompliancePolicies/$newCompliancePolicyId/assignments" -Body $1
But all results in;


Expected behavior
I expect the group to be assigned to said compliance policy.
How to reproduce
- 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'
}
} - 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
- 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
Labels
status:waiting-for-triageAn issue that is yet to be reviewed or assignedAn issue that is yet to be reviewed or assignedtype:bugA broken experienceA broken experience