The script makes use of the following module: Microsoft.PowerApps.Administration.PowerShell
You can install the module using: Install-Module -Name Microsoft.PowerApps.Administration.PowerShell
More info: PowerShell Gallery | Microsoft.PowerApps.Administration.PowerShell 2.0.131
So, here is the script:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
param( [string]$Path = 'c:\temp\powerApps_ConnectionDetails.csv' ) #fetch the list of all PowerApps from the tenant. #when the below CMDLET will execute it will ask for credentials for the tenant $powerApps = Get-AdminPowerApp $powerAppList = @() # loop through each app foreach ($powerApp in $powerApps) { # loop through each connection reference for the respective APP foreach($connectionReference in $powerApp.Internal.properties.connectionReferences) { #loop through each connection from the connection reference foreach($connection in $connectionReference) { foreach ($connectionId in ($connection | Get-Member -MemberType NoteProperty).Name) { #get the connection details $connectionDetails = $($connection.$connectionId) #preparing row $csvRow = @{ AppDisplayName = $powerApp.displayName AppName = $powerApp.appName EnvironmentName = $powerApp.environmentName ConnectorDisplayName = $connectionDetails.displayName ConnectionId = $connectionDetails.id ConnectionName = $connectionDetails.connectionName CreatedByEmail = $powerApp.owner.email IsPremiumConnector = $connectionDetails.apiTier -eq 'Premium' } $powerAppList+= $(new-object psobject -Property $csvRow) } } } } # output to file $powerAppList | Export-Csv -Path $Path |
The results will look similar to the screenshot below:
Enjoy!

