Extracting UPN or DisplayName by importing csv with Object-Id

%3CLINGO-SUB%20id%3D%22lingo-sub-1386396%22%20slang%3D%22en-US%22%3EExtracting%20UPN%20or%20DisplayName%20by%20importing%20csv%20with%20Object-Id%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1386396%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20All%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMicrosoft%20has%20released%20a%20script%20to%20import%20to%20a%20csv%3B%20IOS%20devices%20affected%20by%20a%20passcode%20issue%20within%20Intune.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAs%20an%20organisation%20we%20need%20to%20contact%20each%20of%20these%20users%20and%20ask%20them%20to%20take%20specific%20action.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20issue%20we%20have%20is%20the%20script%20outputs%20only%20object-id%20and%20device%20name.%20There%20seems%20to%20be%20no%20way%20of%20editing%20the%20script%20itself%20to%20produce%20a%20displayname%20or%20email%20address%20so%20that%20we%20know%20which%20users%20to%20contact.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20any%20way%20to%20import%20a%20list%20of%20object-id's%20or%20device%20names%20into%20azure%20powershell%20and%20use%20this%20to%20output%20a%20displayname%20or%20a%20upn%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1386396%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%20Active%20Directory%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%20Data%20Lake%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWindows%20PowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1386923%22%20slang%3D%22en-US%22%3ERe%3A%20Extracting%20UPN%20or%20DisplayName%20by%20importing%20csv%20with%20Object-Id%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1386923%22%20slang%3D%22en-US%22%3E%3CP%3EThere's%20always%20a%20way%2C%20but%20without%20providing%20a%20sample%20it's%20hard%20to%20give%20you%20specific%20examples.%20Is%20the%20device%20object%20ID%20returned%2C%20or%20the%20user%20object%20ID%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1393409%22%20slang%3D%22en-US%22%3ERe%3A%20Extracting%20UPN%20or%20DisplayName%20by%20importing%20csv%20with%20Object-Id%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1393409%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F419573%22%20target%3D%22_blank%22%3E%40dan_birrell%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDo%20you%20have%20the%20script%20or%20a%20link%20to%20it%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1398558%22%20slang%3D%22en-US%22%3ERe%3A%20Extracting%20UPN%20or%20DisplayName%20by%20importing%20csv%20with%20Object-Id%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1398558%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F312381%22%20target%3D%22_blank%22%3E%40PeterJ_Inobits%3C%2FA%3E%26nbsp%3B%20Hi%20Sorry%20Peter%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoftgraph%2Fpowershell-intune-samples%2Fblob%2Fmaster%2FManagedDevices%2FManagedDevices_iOS_PasscodeReset_Export.ps1%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fmicrosoftgraph%2Fpowershell-intune-samples%2Fblob%2Fmaster%2FManagedDevices%2FManagedDevices_iOS_PasscodeReset_Export.ps1%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20is%20the%20script%20Microsoft%20produced.%20The%20output%20just%20doesn't%20allow%20us%20to%20move%20forward%20with%20this%20as%20we%20need%20to%20know%20which%20device%20is%20assigned%20to%20which%20user.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20there%20is%20some%20way%20of%20importing%20object%20id's%20or%20device%20names%20to%20then%20output%20upn's%20then%20that%20would%20suit.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20raised%20a%20ticket%20with%20Microsoft%20and%20they%20came%20back%20and%20said%20they%20don't%20help%20edit%20script.%20Even%20their%20scripts%20written%20to%20fix%20their%20own%20issues%20%3A)%3C%2Fimg%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1399023%22%20slang%3D%22en-US%22%3ERe%3A%20Extracting%20UPN%20or%20DisplayName%20by%20importing%20csv%20with%20Object-Id%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1399023%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F419573%22%20target%3D%22_blank%22%3E%40dan_birrell%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%20Dan%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThat%20script%20returns%20the%20device%20id%20correct%3F%20You%20can%20the%20query%20the%20device%20owner%20based%20on%20the%20device%20id.%20There%20are%20at%20least%20two%20attributes%2C%20registereddeviceowner%20and%20registereddeviceuser%20IIRC.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnother%20approach%20is%20to%20use%20the%20Azure%20Sign%20Logs%20and%20extract%20the%20deviceID%20and%20UserID%20and%20correlate%20them%20against%20the%20output%20provided%20the%20MS%20script%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
New 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?

@dan_birrell 

 

Do you have the script or a link to it?

@PeterJ_Inobits  Hi Sorry Peter

 

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

 

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 :) 

@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