SOLVED

Intune report for users with multiple devices assigned as Primary User

%3CLINGO-SUB%20id%3D%22lingo-sub-2303237%22%20slang%3D%22en-US%22%3EIntune%20report%20for%20users%20with%20multiple%20devices%20assigned%20as%20Primary%20User%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2303237%22%20slang%3D%22en-US%22%3E%3CP%3EAnybody%20knows%20if%20I%20can%20get%20a%20report%20(I%20assume%20from%20Graph)%20which%20only%20displays%20users%20with%20multiple%20devices%20assigned%20(as%20Primary%20User%2C%20which%20most%20likely%20was%20an%20error%20when%20issuing%20replacement%20device%20etc)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESeb%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2303237%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EIntune%20report%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2305665%22%20slang%3D%22en-US%22%3ERe%3A%20Intune%20report%20for%20users%20with%20multiple%20devices%20assigned%20as%20Primary%20User%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2305665%22%20slang%3D%22en-US%22%3EHi%2C%3CBR%20%2F%3EThis%20could%20be%20a%20beginning%3CBR%20%2F%3E%3CBR%20%2F%3Econnect-msgraph%3CBR%20%2F%3E%3CBR%20%2F%3EGet-IntuneManagedDevice%20%7C%20Where-Object%20%7B%24_.operatingSystem%20-match%20%22Windows%22%7D%20%7C%20select-object%20userDisplayName%2CdeviceName%2ClastSyncDateTime%20%7C%20sort-object%20userdisplayname%20%7C%20Out-GridView%3CBR%20%2F%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fscribbleghost.net%2F2019%2F11%2F07%2Fgetting-device-details-from-azure-with-powershell%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fscribbleghost.net%2F2019%2F11%2F07%2Fgetting-device-details-from-azure-with-powershell%2F%3C%2FA%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2305767%22%20slang%3D%22en-US%22%3ERe%3A%20Intune%20report%20for%20users%20with%20multiple%20devices%20assigned%20as%20Primary%20User%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2305767%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F620702%22%20target%3D%22_blank%22%3E%40Rudy_Ooms%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20gives...%20a%20report%20(of%20sorts).%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EIn%20User%20Display%20Name%2C%20it%20only%20shows%20for%20machines%20that%20were%20manually%20Enrolled%20%26amp%3B%20it%20gives%20the%20name%20of%20the%20person%20that%20done%20it%2C%20but%20NOT%20Primary%20User%20(as%20assigned%20in%20Properties)%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Contributor

Anybody knows if I can get a report (I assume from Graph) which only displays users with multiple devices assigned (as Primary User, which most likely was an error when issuing replacement device etc)

 

Thanks

 

Seb

6 Replies
Hi,
This could be a beginning

connect-msgraph

Get-IntuneManagedDevice | Where-Object {$_.operatingSystem -match "Windows"} | select-object userDisplayName,deviceName,lastSyncDateTime | sort-object userdisplayname | Out-GridView

https://scribbleghost.net/2019/11/07/getting-device-details-from-azure-with-powershell/

@Rudy_Ooms 

 

It gives... a report (of sorts). 

In User Display Name, it only shows for machines that were manually Enrolled & it gives the name of the person that done it, but NOT Primary User (as assigned in Properties)

 

Hi,

 

Also tested the script, but you are right indeed, on another blog they were telling this would show the primary user but it doesn't. Just changed a primary user... it is indeed not listed

 
Did you also take a look at this one: It will list all primary users for each device.
I guess if you take some time you can change the script a little bit to get a better report

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

Yes, I am using already these powershell-intune-samples.

Sadly they are build with no option to output to anything apart from screen (without code change), so I do

 

$File="C:\temp\devices.txt"

Start-Transcript $File -Append

.\Win10_PrimaryUser_Get.ps1

Stop-Transcript


Why is so difficult to get proper reporting from MDM?

best response confirmed by Sebastian Cerazy (Contributor)
Solution
https://endpoint.microsoft.com/#blade/Microsoft_Intune_Enrollment/ReportingMenu/deviceCompliance

You could create compliance report, you could export it to csv and if I am reading it correctly the upn shows the primary user (it lists the device I just changed with the correct primary user)
Thanks, I suppose that compliance report is the best I can get quickly for now!