Reputation: 21
In Azure portal on a managed device detail page it shows two types of users, The "Primary" user and the "Enrolled by" user. I'm trying to figure out how I can retrieve the latter using the Microsoft Graph API. What I've tried so far is pretty much every managed device related API. The ones I mainly use are the https://learn.microsoft.com/en-us/graph/api/intune-devices-manageddevice-list?view=graph-rest-1.0 and https://learn.microsoft.com/en-us/graph/api/intune-devices-manageddevice-get?view=graph-rest-1 I've also looked at pretty much all the beta variants of the related API documentation if and when they are available. My problem is that it seems like there is no way to retrieve this information.
Upvotes: 2
Views: 2239
Reputation: 1
And old question and not sure if the information is still relevant or answered elsewhere.
The URIs you will need for this information will be read scopes to:
"https://graph.microsoft.com/v1.0/devices/" and "https://graph.microsoft.com/v1.0/users/"
The information is located in the "physicalIDs" property retrieved from the "Devices" uri, which must be parsed and used to retrieve the user with the "Users" uri
The phsycialIDs is an array containing objects with "[ID]:Value" format as a strings.
The one you need here is the "[USER-GID]" property. This can be split by the ":" delimiter.
The array elements are not in a standardized order, so you will need to find the associated [USER-GID] element manually.
It will most likely be in the format: [USER-GID]:{guid}:{device attributer number}
You can then use the GID GUID retrieved here to resolve the associated identity with the Users URI.
Upvotes: 0