Export Azure AD Joined deivces to CSV

Boopathi S 3,446 Reputation points
2020-10-08T14:11:06.177+00:00

Hi,

Please help how to export Azure AD joined devices with details of Name, Enabled, OS, Version, Join type, Owner information to CSV

31005-capture.jpg

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,116 questions
0 comments No comments
{count} votes

Accepted answer
  1. soumi-MSFT 11,786 Reputation points Microsoft Employee
    2020-10-08T16:53:35.417+00:00

    Hello @Boopathi S , thank you for reaching out. You can use the following PS Cmdlet to fetch all the devices and its properties in a CSV file.

    Connect-AzureAD  
    $PathCsv = "C:\temp\deviceList.csv"  
    $deviceList = Get-AzureADDevice   
    $devices = @()  
      
    foreach($device in $deviceList){  
        $deviceOwner = $device | Get-AzureADDeviceRegisteredOwner  
        $deviceProps = [ordered] @{  
            DeviceName = $device.DisplayName  
            Enabled = $device.AccountEnabled  
            OS = $device.DeviceOSType  
            Version = $device.DeviceOSVersion  
            JoinType = $device.DeviceTrustType  
            Owner = $deviceOwner.DisplayName  
            LastLogonTimestamp = $device.ApproximateLastLogonTimeStamp  
        }  
        $deviceObj = New-Object -Type PSObject -Property $deviceProps  
        $devices += $deviceObj  
    }  
      
    $devices | Export-Csv -Path $PathCsv -NoTypeInformation -Append  
    

    Hope this helps.

    Do let us know if this helps and if there are any more queries around this, please do let us know so that we can help you further. Also, please do not forget to accept the response as Answer; if the above response helped in answering your query.


1 additional answer

Sort by: Most helpful
  1. Belaid Mouffok 1 Reputation point
    2022-09-23T14:34:19.743+00:00

    Hello Soumi,
    Merci pour votre réponce, ce que nous voulons aussi, c'est de récupérer toutes les clés des postes qui sont en Azure AD joind,

    Merci encore,

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.