You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have noticed that the script is matching devices to users based on the user who enrolled the device, instead of who is the Primary User.
Given that the Primary user is what is usually used to track the device owner, I would suggest using this instead if possible.
My research tells me that https://graph.microsoft.com/v1.0/deviceManagement/managedDevices annoyingly returns only the enrollment user, which I assume is why this is used instead of Primary user.
I believe you should be able to use https://graph.microsoft.com/v1.0/deviceManagement/managedDevices/{managedDevice-id}/users (then get the .value.userPrincipalName field from this result instead to get the Primary User, though I don't have the exact know-how of how to do this to create a pull request.
Thanks!
The text was updated successfully, but these errors were encountered:
I have noticed that the script is matching devices to users based on the user who enrolled the device, instead of who is the Primary User.
Given that the Primary user is what is usually used to track the device owner, I would suggest using this instead if possible.
My research tells me that
https://graph.microsoft.com/v1.0/deviceManagement/managedDevices
annoyingly returns only the enrollment user, which I assume is why this is used instead of Primary user.I believe you should be able to use
https://graph.microsoft.com/v1.0/deviceManagement/managedDevices/{managedDevice-id}/users
(then get the.value.userPrincipalName
field from this result instead to get the Primary User, though I don't have the exact know-how of how to do this to create a pull request.Thanks!
The text was updated successfully, but these errors were encountered: