Forum Discussion

Simphiwe_Mkhize01's avatar
Simphiwe_Mkhize01
Copper Contributor
May 27, 2019

Report AAD Users together with their Registered Device

Hi Guys

Need assistance to get a report of Azure AD users together with their registered device name, I`m trying the following command but I`m not getting the correct results:

 

Foreach User in “Get-ADUser -All” {

              UserCreds = Get-AzureADUserRegisteredDevice -ObjectId $User              

}

10 Replies

  • Moe_Kinani's avatar
    Moe_Kinani
    Bronze Contributor
    Long term approach:

    You use Intune Data warehouse reporting to have insight on your environment.

    https://docs.microsoft.com/en-us/intune/developer/reports-nav-create-intune-reports

    Moe
  • This has been answered several times already, do a search next time :)

     

    Get-AzureADUser | % {$DeviceOwner = $_.UserPrincipalName; Get-AzureADUserRegisteredDevice -ObjectId $_.ObjectId } | select @{n="DeviceOwner";e={$DeviceOwner}},DisplayName,DeviceOSType,ApproximateLastLogonTimeStamp
    • Simphiwe_Mkhize01's avatar
      Simphiwe_Mkhize01
      Copper Contributor

      VasilMichev thanks for the script and I did try it but it doesn`t bring the results, please see attached screenshot. 

       

      • VasilMichev's avatar
        VasilMichev
        MVP

         

        Try using an account that has sufficient permissions to enumerate users in the directory as well as call the Get-AzureADUserRegisteredDevice cmdlet.

Resources