All scripts
Governance 236

Get-PowerAutomateFlowOwnerReport

Lists every Power Automate flow across the tenant grouped by owner, flagging flows owned by individual users rather than a shared account, since those break the moment that person leaves.

Get-PowerAutomateFlowOwnerReport.ps1
<#
.SYNOPSIS
    Reports Power Automate flow ownership across the tenant.

.DESCRIPTION
    Lists every flow across all environments grouped by owner, flagging
    flows owned by an individual user account rather than a shared or
    application account, since those break the moment that person's
    account is disabled.

.EXAMPLE
    .\Get-PowerAutomateFlowOwnerReport.ps1

.NOTES
    Requires the Microsoft.PowerApps.Administration.PowerShell module and
    an active Add-PowerAppsAccount session.

.AUTHOR
    Shehryar Hassan
#>

$environments = Get-AdminPowerAppEnvironment

$report = foreach ($env in $environments) {
    $flows = Get-AdminFlow -EnvironmentName $env.EnvironmentName
    foreach ($flow in $flows) {
        [pscustomobject]@{
            FlowName    = $flow.DisplayName
            Environment = $env.DisplayName
            Owner       = $flow.CreatedBy.userPrincipalName
            State       = $flow.Enabled
        }
    }
}

$report | Group-Object Owner | Sort-Object Count -Descending |
    Select-Object -First 15 Name, Count | Format-Table -AutoSize

Write-Host "$($report.Count) flow(s) across $($environments.Count) environment(s)" -ForegroundColor Cyan

Read it before you run it, and test in a safe tenant first.