Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPE:Import-SPE-DeviceCompliancePolicies.ps1 exclusionGroupAssignmentTarget and groupAssignmentTarget broken #10

Open
adelino-sdsu opened this issue Nov 19, 2021 · 1 comment

Comments

@adelino-sdsu
Copy link

Was running MasterScript-SPE.ps1, running into this error on each Device Compliance Policy

Response content:
{"error":{"code":"BadRequest","message":"Invalid OData type specified: \"microsoft.graph.#microsoft.graph.exclusionGroupAssignmentTarget\"","innerError":{"date":"2021-11-19T19:27:57","request-id":"3f0e46b6-a2b4-4863-a0b7-fd46c1c4d0cd","client-request-id":"3f0e46b6-a2b4-4863-a0b7-fd46c1c4d0cd"}}}
Add-DeviceCompliancePolicyAssignment : Request to
https://graph.microsoft.com/v1.0/deviceManagement/deviceCompliancePolicies/a47b7f6c-4839-499e-a28b-50be9940b832/assign
failed with HTTP Status BadRequest Bad Request
At C:\users\adelino\downloads\securedworkstation-master\securedworkstation-master\SPE\Import-SPE-DeviceCompliancePolici
es.ps1:625 char:13
+             Add-DeviceCompliancePolicyAssignment -ComplianceAssignmen ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Add-DeviceCompliancePolicyAssignment

I was able to get it working by

  1. Modifying Import-SPE-DeviceCompliancePolicies.ps1 line 615 from

old: "@odata.type": "#microsoft.graph.$Assignment",
fixed: "@odata.type": "$Assignment",

@simorjay
Copy link
Member

simorjay commented Mar 2, 2023

Thanks for the feedback - will work with the team to resolve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants