Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EPM Device is matching users on Enrollment User instead of Primary User #12

Open
mpowelltech opened this issue Jan 10, 2023 · 0 comments

Comments

@mpowelltech
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant