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.