Share via

Export Azure AD Joined deivces to CSV

Boopathi S 3,886 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 Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} votes

Answer accepted by question author
  1. soumi-MSFT 11,861 Reputation points Microsoft Employee Moderator
    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' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.