Skip to content

[FEATURE] check for multiple devices returned from Graph query on check device assignments #94

@corylobrien

Description

@corylobrien

Is your feature request related to a problem? Please describe.
Graph device query filter on displayName often results in 2 or more device results in my current client's environment. One reason for that is Entra Hybrid joined Autopilot profile, causing one Entra Hybrid joined and one Entra joined device. But there are other reasons, too.

This script runs assignment checks on the first objectId returned from the Graph query, evidenced by the objectId returned in result exports and comparing results from a manual query in Graph Explorer. The first objectId does not always match up to an Intune device. Group membership for these Entra devices can vary due to dynamic device group queries.

Describe the solution you'd like
At least notify the user multiple devices were found with the displayName provided and advise them to double-check group assignments listed in the results are as expected.

Also, modify the Graph query to filter on additional properties to ensure an Intune device is selected if multiples exist in Entra. Possibly filter on isManaged, mdmAppId (Intune or ConfigMgr) or others.

Describe alternatives you've considered
Show the user a list of devices found and provide a way to select which one to check assignments.
or
Run the checks on all devices found as if the user entered multiple devices.

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions