I often find myself looking in Intune to find a PC name of a machine assigned to a user (it saves having to deploy bginfo or similar), but as with many of my scripts, I like to find a quicker and easier way of doing it.
This one is available both on github and Powershell Gallery:
Install-Script -Name get-intune-details-from-user
It’s nice and simple to use, run the script and you’ll be prompted for the user to search for. This is an exact search on the UPN:
You’ll then get a grid-view output of all devices assigned to the user. If that’s all you need, click Cancel and the box will close
If, however, you want some more juicy details, select the machine and click OK and you’ll get a menu
These are pretty self-explanatory
Device Info gives a full output
Configuration policies gives a list of all policies applied and their status
Compliance policies shows the compliance status
And finally apps shows discovered applications (not managed) and the version
That’s it, simple, but effective. I created some custom functions using the graph API to call the details, they can all be found in the script on github