microsoftgraph/msgraph-beta-sdk-dotnet

Expanding detected apps does not work

retirem opened this issue · 2 comments

Hi!

I wanted to query the managed devices and all the detected apps per device.

For this, I used the following query:

var managedDevices = (await client.DeviceManagement.ManagedDevices.GetAsync((configuration) =>
        {
            configuration.QueryParameters.Expand= new string[] { "detectedApps" };
        }, cancellationToken: cancellationToken)).Value;
The DetectedApps property of each device showed an empty list.

Windows 11
Beta SDK 5.11.0

Thanks for raising this @Technomann,

As detectedApps is a navigation property it may not support the expand query option on it.
As this is an API related feature, this can be confirmed by asking the question at the link below to confirm the same from the API team(https://learn.microsoft.com/en-us/answers/tags/161/ms-graph).

You may be able to get the detected apps for a given managed device as below.

var detectedApps = await graphClient.DeviceManagement.ManagedDevices["device-id"].DetectedApps.GetAsync();

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.