Other Intune-related topics, including unsupported scenarios and platform-specific behaviors
@Vladimir Tataurov, Thanks for posting in Q&A. The reason for the difference in the number of detected apps obtained through the two methods is due to the difference in the way the data is queried.
The first method DeviceManagement.ManagedDevices[deviceId].DetectedApps.Request().GetAsync() returns only the detected apps for the specific device ID provided, whereas the second method (DeviceManagement.ManagedDevices[deviceId].Request().Expand(d => d.DetectedApps).GetAsync()).DetectedApps returns all the detected apps for the device ID provided and any related devices.
Therefore, the second method returns a larger number of detected apps as it includes those detected on related devices.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.