msgraph-sdk-powershell icon indicating copy to clipboard operation
msgraph-sdk-powershell copied to clipboard

Get-MgDeviceManagementDeviceConfigurationAssignment returns empty target

Open michaeldcanady opened this issue 1 year ago • 0 comments

Describe the bug

I am trying to query a specific configuration profile's assignments but it's returning assignments with "Target" property missing.

Expected behavior

returns assignments with target.

How to reproduce

  1. Execute Connect-MgGraph -Scopes "DeviceManagementConfiguration.ReadWrite.All"
  2. Execute Get-MgDeviceManagementDeviceConfigurationAssignment -DeviceConfigurationId {deviceConfigurationId}

SDK Version

2.16.0

Latest version known to work for scenario above?

No response

Known Workarounds

run api call manually using Invoke-MgGraphRequest: Invoke-MgGraphRequest -Method GET -Uri "/v1.0/deviceManagement/deviceConfigurations/$($configurationProfile.Id)/assignments"

Debug output

DEBUG: [CmdletBeginProcessing]: - Get-MgDeviceManagementDeviceConfigurationAssignment begin processing with parameterSet 'List'. DEBUG: [Authentication]: - AuthType: 'AppOnly', TokenCredentialType: 'ClientSecret', ContextScope: 'Process', AppName: 'REDACTED'. DEBUG: [Authentication]: - Scopes: [DeviceManagementManagedDevices.Read.All, Device.Read.All, Group.ReadWrite.All, User.Read.All, DeviceManagementConfiguration.ReadWrite.All]. DEBUG: ============================ HTTP REQUEST ============================

HTTP Method: GET

Absolute Uri: https://graph.microsoft.com/v1.0/deviceManagement/deviceConfigurations/{REDACTED}/assignments

Headers: FeatureFlag : 00000043 Cache-Control : no-store, no-cache User-Agent : Mozilla/5.0,(Windows NT 10.0; Microsoft Windows 10.0.22631; en-US),PowerShell/2024.2.1 Accept-Encoding : gzip SdkVersion : graph-powershell/2.16.0 client-request-id : 1f898a68-779d-4097-bf83-09388fc05fa6

Body:

DEBUG: ============================ HTTP RESPONSE ============================

Status Code: OK

Headers: Vary : Accept-Encoding Strict-Transport-Security : max-age=31536000 request-id : aa760a65-ad0e-4850-b238-77fcbd9d0bd2 client-request-id : 1f898a68-779d-4097-bf83-09388fc05fa6 x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"East US 2","Slice":"E","Ring":"5","ScaleUnit":"000","RoleInstance":"BN5PEPF0000E134"}} odata-version : 4.0 Date : Tue, 14 May 2024 19:55:38 GMT

Body: { "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#deviceManagement/deviceConfigurations('{REDACTED}')/assignments", "value": [ { "id": "{REDACTED}", "target": { "@odata.type": "#microsoft.graph.groupAssignmentTarget", "groupId": "a9cf9631-72c0-4e9f-8a13-03259a28463d" } } ] }

DEBUG: [CmdletEndProcessing]: - Get-MgDeviceManagementDeviceConfigurationAssignment end processing.

Configuration

  • PSVersion 7.4.1
  • PSEdition Core
  • GitCommitId 7.4.1
  • 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

Other information

No response

michaeldcanady avatar May 14 '24 19:05 michaeldcanady