Closed Perrinw closed 3 years ago
Hi not sure if you already found the cause. But you are seeing this error, because probably there is a group removed, without removing the assignments first and then removing it in AAD. If you know were the group had access to, edit the app or policy assignment and remove it and save . This is bug in Azure, this can be workaround in this script but that requires @ThomasKur The get-groups used is leveraged the ms.graph module, also graph shows the removed group.
The Invoke-PrintAssignmentDetail_Assignment should do a try and catch with the get-groups and get-groups_members, and if error do X or some sort. I tried to do that but it now goes wrong on something with adding it to the word table.
Thank you for the feedback. I have added a fix in the next version. I will release it soon.
Hello, i'm getting the error below. I've ran this before with no issues. This is a test environment I'm running this on.
Get-Groups : 404 Not Found { "error": { "code": "Request_ResourceNotFound", "message": "Resource '98abd59d-976f-4b23-b4f2-185b3450267a' does not exist or one of its queried reference-property objects are not present.", "innerError": { "date": "2021-03-16T18:09:57", "request-id": "88f7adec-286d-4ccb-a837-a9a9f75ca14a", "client-request-id": "88f7adec-286d-4ccb-a837-a9a9f75ca14a" } } } At C:\Program Files\WindowsPowerShell\Modules\IntuneDocumentation\2.0.19\Internal\Invoke-PrintAssignmentDetail_Assignment.ps1:25 char:21
Get-Groups_Members : 404 Not Found { "error": { "code": "Request_ResourceNotFound", "message": "Resource '98abd59d-976f-4b23-b4f2-185b3450267a' does not exist or one of its queried reference-property objects are not present.", "innerError": { "date": "2021-03-16T18:09:57", "request-id": "3304d2d4-fb6b-43e9-94e9-1fd19141ac41", "client-request-id": "3304d2d4-fb6b-43e9-94e9-1fd19141ac41" } } } At C:\Program Files\WindowsPowerShell\Modules\IntuneDocumentation\2.0.19\Internal\Invoke-PrintAssignmentDetail_Assignment.ps1:36 char:20
Add-WordTable : Object reference not set to an instance of an object. At C:\Program Files\WindowsPowerShell\Modules\IntuneDocumentation\2.0.19\Internal\Invoke-PrintAssignmentDetail.ps1:29 char:33
Get-Groups : 404 Not Found { "error": { "code": "Request_ResourceNotFound", "message": "Resource '98abd59d-976f-4b23-b4f2-185b3450267a' does not exist or one of its queried reference-property objects are not present.", "innerError": { "date": "2021-03-16T18:09:57", "request-id": "34f5cfb0-d60f-4d57-b018-cc88783ac4b7", "client-request-id": "34f5cfb0-d60f-4d57-b018-cc88783ac4b7" } } } At C:\Program Files\WindowsPowerShell\Modules\IntuneDocumentation\2.0.19\Internal\Invoke-PrintAssignmentDetail_Assignment.ps1:25 char:21
Get-Groups_Members : 404 Not Found { "error": { "code": "Request_ResourceNotFound", "message": "Resource '98abd59d-976f-4b23-b4f2-185b3450267a' does not exist or one of its queried reference-property objects are not present.", "innerError": { "date": "2021-03-16T18:09:58", "request-id": "d7e50f52-8ed5-42ad-8177-09f8949d93f4", "client-request-id": "d7e50f52-8ed5-42ad-8177-09f8949d93f4" } } } At C:\Program Files\WindowsPowerShell\Modules\IntuneDocumentation\2.0.19\Internal\Invoke-PrintAssignmentDetail_Assignment.ps1:36 char:20
Add-WordTable : Object reference not set to an instance of an object. At C:\Program Files\WindowsPowerShell\Modules\IntuneDocumentation\2.0.19\Internal\Invoke-PrintAssignmentDetail.ps1:29 char:33
Get-Groups : 404 Not Found { "error": { "code": "Request_ResourceNotFound", "message": "Resource '98abd59d-976f-4b23-b4f2-185b3450267a' does not exist or one of its queried reference-property objects are not present.", "innerError": { "date": "2021-03-16T18:09:58", "request-id": "ac787286-6e6a-43c0-b921-edaf58deb5a4", "client-request-id": "ac787286-6e6a-43c0-b921-edaf58deb5a4" } } } At C:\Program Files\WindowsPowerShell\Modules\IntuneDocumentation\2.0.19\Internal\Invoke-PrintAssignmentDetail_Assignment.ps1:25 char:21
Get-Groups_Members : 404 Not Found { "error": { "code": "Request_ResourceNotFound", "message": "Resource '98abd59d-976f-4b23-b4f2-185b3450267a' does not exist or one of its queried reference-property objects are not present.", "innerError": { "date": "2021-03-16T18:09:58", "request-id": "07a0a9f6-7cbd-438f-ac98-33abddcd3540", "client-request-id": "07a0a9f6-7cbd-438f-ac98-33abddcd3540" } } } At C:\Program Files\WindowsPowerShell\Modules\IntuneDocumentation\2.0.19\Internal\Invoke-PrintAssignmentDetail_Assignment.ps1:36 char:20
Add-WordTable : Object reference not set to an instance of an object. At C:\Program Files\WindowsPowerShell\Modules\IntuneDocumentation\2.0.19\Internal\Invoke-PrintAssignmentDetail.ps1:29 char:33
Get-Groups : 404 Not Found { "error": { "code": "Request_ResourceNotFound", "message": "Resource '98abd59d-976f-4b23-b4f2-185b3450267a' does not exist or one of its queried reference-property objects are not present.", "innerError": { "date": "2021-03-16T18:09:58", "request-id": "f605b4fc-ebdf-40f3-9830-f8cb94645cae", "client-request-id": "f605b4fc-ebdf-40f3-9830-f8cb94645cae" } } } At C:\Program Files\WindowsPowerShell\Modules\IntuneDocumentation\2.0.19\Internal\Invoke-PrintAssignmentDetail_Assignment.ps1:25 char:21
Get-Groups_Members : 404 Not Found { "error": { "code": "Request_ResourceNotFound", "message": "Resource '98abd59d-976f-4b23-b4f2-185b3450267a' does not exist or one of its queried reference-property objects are not present.", "innerError": { "date": "2021-03-16T18:09:59", "request-id": "4e1b8bb4-d163-4ef9-8a35-81395fbc6e6c", "client-request-id": "4e1b8bb4-d163-4ef9-8a35-81395fbc6e6c" } } } At C:\Program Files\WindowsPowerShell\Modules\IntuneDocumentation\2.0.19\Internal\Invoke-PrintAssignmentDetail_Assignment.ps1:36 char:20
Add-WordTable : Object reference not set to an instance of an object. At C:\Program Files\WindowsPowerShell\Modules\IntuneDocumentation\2.0.19\Internal\Invoke-PrintAssignmentDetail.ps1:29 char:33