Forum Discussion

dan_birrell's avatar
dan_birrell
Copper Contributor
May 13, 2020

Extracting UPN or DisplayName by importing csv with Object-Id

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?

  • 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?

    • dan_birrell's avatar
      dan_birrell
      Copper Contributor

      PeterJ_Inobits  Hi Sorry Peter

       

      https://github.com/microsoftgraph/powershell-intune-samples/blob/master/ManagedDevices/ManagedDevices_iOS_PasscodeReset_Export.ps1

       

      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 🙂 

      • PeterJ_Inobits's avatar
        PeterJ_Inobits
        Iron Contributor

        dan_birrell 

         

        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 

Resources