Extracting UPN or DisplayName by importing csv with Object-Id

Copper Contributor

Hi All


Microsoft has released a script to import to a csv; IOS devices affected by a passcode issue within Intune.


As an organisation we need to contact each of these users and ask them to take specific action.


The issue we have is the script outputs only object-id and device name. There seems to be no way of editing the script itself to produce a displayname or email address so that we know which users to contact.


Is there any way to import a list of object-id's or device names into azure powershell and use this to output a displayname or a upn?

4 Replies

There's always a way, but without providing a sample it's hard to give you specific examples. Is the device object ID returned, or the user object ID?



Do you have the script or a link to it?

@PeterJ_Inobits  Hi Sorry Peter




This is the script Microsoft produced. The output just doesn't allow us to move forward with this as we need to know which device is assigned to which user.


If there is some way of importing object id's or device names to then output upn's then that would suit.


I raised a ticket with Microsoft and they came back and said they don't help edit script. Even their scripts written to fix their own issues :) 



Hi Dan


That script returns the device id correct? You can the query the device owner based on the device id. There are at least two attributes, registereddeviceowner and registereddeviceuser IIRC. 


Another approach is to use the Azure Sign Logs and extract the deviceID and UserID and correlate them against the output provided the MS script