Forum Discussion
Simphiwe_Mkhize01
May 27, 2019Copper Contributor
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 “G...
VasilMichev
May 27, 2019MVP
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
- singhRaghvendra95Jan 28, 2020Copper Contributor
VasilMichev This returns value with single user. Please suggest query with same results for all users.
- Thijs LecomteJan 28, 2020Bronze ContributorYou should do 'Get-AzureADUser -all $true'
- Simphiwe_Mkhize01May 28, 2019Copper Contributor
VasilMichev thanks for the script and I did try it but it doesn`t bring the results, please see attached screenshot.
- VasilMichevMay 28, 2019MVP
Try using an account that has sufficient permissions to enumerate users in the directory as well as call the Get-AzureADUserRegisteredDevice cmdlet.
- Simphiwe_Mkhize01May 28, 2019Copper Contributor
VasilMichev will try that and give feedback.