11-22-2018 10:53 PM
Hi all,
Can you please help me to export Azure AD join device list from azure portal?
Thanks and Regards,
Shubham Kumar
11-23-2018 09:06 AM - edited 11-23-2018 09:07 AM
SolutionHi Shubham,
You can get a list of Azure AD joined devices through the Get-MsolDevice cmdlet in Powershell.
https://docs.microsoft.com/en-us/powershell/module/msonline/get-msoldevice?view=azureadps-1.0
The Get-MsolDevice -All -ReturnRegisteredOwners cmdlet will output a list of all devices and their owners which contain the output DeviceTrustType which is the device trust type. The value could be one of the following: Workplace Joined, AzureAD Joined, Domain Joined.
All you need to do is combine this with an export command such as | Export-Csv C:\Temp\LicensedUsers.csv and this should give you the list.
AFAIK, there isn't a way to do this through the portal currently.
Best, Chris
02-07-2019 05:50 AM
When i try to export the list with registeredowners i am getting
System.Collections.Generic.List`1[System.String] |
in the output. can you help me provide the correct expression?
04-30-2019 07:46 AM - edited 04-30-2019 08:35 AM
Has there been any more answers on this? I am getting the same issue when running the commands. @Praneeth Rajalingari @Christopher Hoard
05-02-2019 06:23 AM
I am also getting System.Collections.Generic.List`1[System.String] for the registered owners. I've tried various methods to get the data to populate, however, since the username is behind {} it never seems to want to populate correctly. Is the output an array of some sort, or just a generic text output? I need this to more accurately control my inventory. @Christopher Hoard
05-03-2019 07:19 AM
06-14-2019 11:01 AM
@jamesOnco360Wondering if anyone has resolved the issue with returning the
System.Collections.Generic.List`1[System.String] |
result for Registered owners (instead of the UPN) when running the Azure AD Get-MSolDevice script and exporting to csv. Thanks! @Christopher Hoard
08-13-2019 02:00 PM
Does this produce the desired result?
Connect-MsolService
$TStamp = $(get-date -f MM-dd-yyyy_HH_mm_ss)
$Devices = Get-MsolDevice -All -ReturnRegisteredOwners -IncludeSystemManagedDevices
$DeviceInfo = @()
foreach ($Device in $Devices) {
$DeviceInfo += [PSCustomObject]@{
"DisplayName" = $Device.DisplayName
"DeviceTrustType" = $Device.DeviceTrustType
"DeviceTrustLevel" = $Device.DeviceTrustLevel
"DeviceOS" = $Device.DeviceOsType
"DeviceVersion" = $Device.DeviceOsVersion
"RegisteredOwner" = $($Device.RegisteredOwners)
"LastLogon" = $Device.ApproximateLastLogonTimestamp
"LastDirSync" = $Device.LastDirSyncTime
"DeviceID" = $Device.DeviceId
"ObjectID" = $Device.ObjectId
}
}
$DeviceInfo | Export-Csv -NoTypeInformation .\"Device Info - $TStamp.csv"
09-02-2019 02:20 AM
@kennedy_shane I think it does but why do things in 15 lines when you could do it in one
Get-MsolDevice -All -ReturnRegisteredOwners -IncludeSystemManagedDevices | Select-Object *,@{Name='RegisteredOwnersToString';Expression = {$_.RegisteredOwners.Normalize()}} | Export-Csv devices.csv
10-25-2019 12:45 AM
@Christopher HoardVery easy, very nice, thanks for the short Oneliner..
But how to make, if i have to read more than thousand devices?
04-16-2020 09:05 AM
We can export all information using this cmd as well: Get-MsolDevice -All | Export-CSV .\Devices.csv
However, I need the exact Particulars as highlighted in the below screenshot. Is it possible?
Your quick response will be highly appreciated. Thank you
05-26-2020 01:40 AM
I'm trying to export this information from Azure too. @Global_Admin . get-msoldevice does not return the same values. Is 'domain joined' equivalent to Hybrid Azure AD joined?
Mike