Connect-AzureAD # Retrieve all the applications in the tenant $applications = Get-AzureADApplication # Loop through each application and retrieve its owner foreach ($application in $applications) { $owner = Get-AzureADApplicationOwner -ObjectId $application.ObjectId Write-Output "Application Name: $($application.DisplayName), Owner: $($owner.DisplayName)" } # Export the results to a CSV file $csvPath = "C:\temp\applications105.csv" Write-Host "CSV file will be saved at: $csvPath" $results | Export-Csv -Path $csvPath -NoTypeInformation