Azure: List of people who dont have a device

dded 21 Reputation points
2021-10-06T13:31:25.557+00:00

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!

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,484 questions
{count} votes

Accepted answer
  1. Paul van Berlo 821 Reputation points
    2021-10-07T06:56:15.193+00:00

    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
    
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Jai Verma 461 Reputation points
    2021-10-06T18:33:37.127+00:00

    @dded 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 person found this answer helpful.

  2. Marilee Turscak-MSFT 36,246 Reputation points Microsoft Employee
    2021-10-06T19:05:33.873+00:00

    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://learn.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 person found this answer helpful.