You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Running the Powershell commands to get assignment targets for Intune devices (apps, compliance policies etc.) return an object with no properties. The commands appear to return the empty base class (deviceAndAppManagementAssignmentTarget) rather than the type of the target (for example groupAssignmentTarget, which is a child of deviceAndAppManagementAssignmentTarget). It correctly responds with the ID of the assignment target object but the object itself has no properties, meaning there is no way see what anything is actually assigned to.
Running the equivalent commands directly to the Graph API over HTTP respond with the correct object type.
To Reproduce
Steps to reproduce the behavior:
Execute Get-MgDeviceManagementDeviceCompliancePolicyAssignment with -DeviceCompliancePolicyId $compliancePolicyId
See error at ... (No Error, there is a response)
Expected behavior
Get-MgDeviceManagementDeviceCompliancePolicyAssignment should respond with a collection of objects inheriting from deviceAndAppManagementAssignmentTarget (groupAssignmentTarget) which include additional information specifying what the compliance policy is assigned to.
Name Value
---- -----
PSVersion 7.3.9
PSEdition Core
GitCommitId 7.3.9
OS Microsoft Windows 10.0.19045
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Screenshots
Command run in powershell:
Equivalent HTTP call to Graph:
Additional context
The debug output shows the object types correctly being returned as groupAssignmentTarget when the command calls the endpoint. It pulls the ID out of the response correctly, but "Target" becomes Microsoft.Graph.PowerShell.Models.MicrosoftGraphDeviceAndAppManagementAssignmentTarget. My assumption is that this should be something like Microsoft.Graph.PowerShell.Models.MicrosoftGraphGroupAssignmentTarget? If this is intended behavior, how am I supposed to use the Microsoft.Graph.PowerShell.Models.MicrosoftGraphDeviceAndAppManagementAssignmentTarget? There doesn't appear to be a way to use this object (or its ID) to get any info about what things are actually assigned to.
The text was updated successfully, but these errors were encountered:
Hi @tyler-the-freeman ,
I reproduced the issue but added the -ExandpandProperty target to modify the graph request to something like this "https://graph.microsoft.com/v1.0/deviceManagement/deviceCompliancePolicies//assignments?$expand=target" expecting the target property to be expanded. Unfortunately, the service is not able to expand that and so the SDK cannot do the same. (See image below)
Therefore, this seems to be an API related issue and we are not best placed to give an answer. Kindly raise an issue here https://developer.microsoft.com/en-us/graph/support so that the API owner can respond to it.
However, you can use Invoke-MgGraphRequest to get through to the object contents.
For example: $result= Invoke-MgGraphRequest -Method GET -OutputType HashTable -Uri "https://graph.microsoft.com/v1.0/deviceManagement/deviceCompliancePolicies/<ID>/assignments"
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.
Thanks for reporting the bug. Please ensure you've gone through the following checklist before opening an issue:
Describe the bug
Running the Powershell commands to get assignment targets for Intune devices (apps, compliance policies etc.) return an object with no properties. The commands appear to return the empty base class (deviceAndAppManagementAssignmentTarget) rather than the type of the target (for example groupAssignmentTarget, which is a child of deviceAndAppManagementAssignmentTarget). It correctly responds with the ID of the assignment target object but the object itself has no properties, meaning there is no way see what anything is actually assigned to.
Running the equivalent commands directly to the Graph API over HTTP respond with the correct object type.
To Reproduce
Steps to reproduce the behavior:
Get-MgDeviceManagementDeviceCompliancePolicyAssignment
with-DeviceCompliancePolicyId $compliancePolicyId
...
(No Error, there is a response)Expected behavior
Get-MgDeviceManagementDeviceCompliancePolicyAssignment should respond with a collection of objects inheriting from deviceAndAppManagementAssignmentTarget (groupAssignmentTarget) which include additional information specifying what the compliance policy is assigned to.
Debug Output
Module Version
Environment Data
Screenshots
Command run in powershell:
Equivalent HTTP call to Graph:
Additional context
The debug output shows the object types correctly being returned as groupAssignmentTarget when the command calls the endpoint. It pulls the ID out of the response correctly, but "Target" becomes Microsoft.Graph.PowerShell.Models.MicrosoftGraphDeviceAndAppManagementAssignmentTarget. My assumption is that this should be something like Microsoft.Graph.PowerShell.Models.MicrosoftGraphGroupAssignmentTarget? If this is intended behavior, how am I supposed to use the Microsoft.Graph.PowerShell.Models.MicrosoftGraphDeviceAndAppManagementAssignmentTarget? There doesn't appear to be a way to use this object (or its ID) to get any info about what things are actually assigned to.
The text was updated successfully, but these errors were encountered: