Nov 04 2019
08:01 AM
- last edited on
Jan 14 2022
04:36 PM
by
TechCommunityAP
Nov 04 2019
08:01 AM
- last edited on
Jan 14 2022
04:36 PM
by
TechCommunityAP
Trying to extract a list (csv or excel) file for all Azure AD devices with the properties displayed on the Azure Portal (see attached picture)
Nov 04 2019 08:24 AM
Are you familiar with Powershell? Simple option is to run the following in powershell to export all your list
#Connect into Azure AD
Connect-Azure AD
#Download all Azure AD Device
Get-AzureADDevice -All $true | export-csv AADDevice.csv
-Sankara
Nov 06 2019 07:19 AM
@Sankara_Subramanian Thanks I've run that but still missing the Join Type and Owner columns how do I get those?
Nov 06 2019 07:18 PM - edited Nov 06 2019 07:21 PM
Since you seem familiar, I'll refer you to the documentation: https://docs.microsoft.com/en-us/powershell/module/azuread/?view=azureadps-2.0#devices
What I like to do when creating a report like this is piping Format-List (FL for short) so I can see what's all the information available to me.
To start: Get-AzureADDevice -Searchstring "YourDeviceName" | Format-List
You can them combine/pipe with others to find what you need.
It looks like there is a specific command to find the owner. If you can't find what you need, you might need to use Graph API to retrieve those. https://docs.microsoft.com/en-us/graph/api/resources/intune-graph-overview?view=graph-rest-1.0
Apr 29 2020 04:09 AM
Get-AzureADDevice will help DeviceTrustType is the column to check in the result
If DeviceTrustType = ServerAd then the device is Hybrid Azure AD joined
If DeviceTrustType = Workplace then the device is Azure AD registered
Jun 03 2020 12:52 PM
Thank you for this information. And based on the other responses, I was able to establish counts for each join type:
(Get-AzureADDevice -All $true | Where {$_.DeviceTrustType -eq "ServerAd"}).count
(Get-AzureADDevice -All $true | Where {$_.DeviceTrustType -eq "AzureAd"}).count
(Get-AzureADDevice -All $true | Where {$_.DeviceTrustType -eq "Workplace"}).count
Or combine a couple:
(Get-AzureADDevice -All $true | Where {($_.DeviceTrustType -eq "ServerAd") -or ($_.DeviceTrustType -eq "AzureAd")}).count
Or all Azure AD Devices:
(Get-AzureADDevice -All $true).count
Nov 09 2020 08:09 AM
Jun 10 2021 11:18 AM
You can do all this in 1 line using Group-Object.
Get-AzureADDevice | Group-Object DeviceTrustType | Select-Object Count,Name | Sort-Object Count