question

DenisDedic-6834 avatar image
0 Votes"
DenisDedic-6834 asked pvanberlo answered

Azure: List of people who dont have a device

Hello,

im using Azure to keep track of our Users and Devices in our Company.
Now im need of a list of all our current (active) users that dont have a device attached to them in Azure or Admin Center.

Is there a way to generate a list like that somehow? Or is there a filter or a column-option that im blindly missing?

Thank you in advance!

azure-active-directory
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @DenisDedic-6834 ,

Please kindly understand under Exchange online tag, we mainly focus on general issues about Exchange. Considering that your issue may be more related to Azure, I would delete Exchange tag under your post to solve it better. Thanks for your understanding and hope your issue would be resolved soon.

1 Vote 1 ·
pvanberlo avatar image
0 Votes"
pvanberlo answered

You can use the script below. It may take a while to finish depending on how many users and devices you have, but it will return for each UPN the number of devices they have.

 $Result = @()
 $Users = Get-AzureADUser -All $true | Select UserPrincipalName,ObjectId
 ForEach ($User in $Users) {
     $Devices = Get-AzureADUserRegisteredDevice -ObjectId $User.ObjectId
     $Result += New-Object PSObject -Property @{
         UserPrincipalName = $User.UserPrincipalName
         DeviceCount = $Devices.Count
     }
 }
    
 $Result
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JaiVerma-7010 avatar image
1 Vote"
JaiVerma-7010 answered DenisDedic-6834 commented

@DenisDedic-6834 I am not sure what kinds of devices you have, registered, azure ad join, hybrid azure ad join but try one of the following methods

  • get-msoldevice -All (Look for registeredOwenerUPN).

  • Get-AzureADDeviceRegisteredOwner



· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I will try this first thing in the morning, thank you!

0 Votes 0 ·
MarileeTurscak-MSFT avatar image
1 Vote"
MarileeTurscak-MSFT answered DenisDedic-6834 commented

One thing you could do is query a list of all of the users into a CSV file using Get-AzureADUser -ALL. Then you could check whether the users have the device owner attribute.

Another way to do this is to check whether users have Intune licenses assigned. https://docs.microsoft.com/en-us/azure/active-directory/users-groups-roles/groups-dynamic-membership#multi-value-properties

Reference from related thread: Is there a way to pull a list of users from AAD with certain criteria IE. no devices attached to their account?


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I will try this first thing in the morning, thank you!

0 Votes 0 ·