How can I get the flows that need my attention across tenant?

If the number of environments in the tenant is less than 500, use the following script to get all the flows that need licenses across the tenant:

$environments = Get-AdminPowerAppEnvironment


$allFlows = @()
foreach ($env in $environments) {
Write-Host "Getting flows at risk of suspension for environment $($env.DisplayName)..."
$flows = Get-AdminFlowAtRiskOfSuspension -EnvironmentName $env.EnvironmentName
Write-Host "Found $($flows.Count) flows at risk of suspension."
$allFlows += $flows
}

Write all flows to a CSV file

$allFlows | Export-Csv -Path “flows.csv” -NoTypeInformation

Write-Host “All flows at risk of suspension written to flows.csv”


Discover more from PowerBites

Subscribe to get the latest posts sent to your email.

Leave a comment