I recently needed to export a list of all Power Automate Flows from a tenant, along with details of any connectors they were using to read/write data such as SharePoint Online, Dataverse and Outlook. I needed this for preparation for a tenant-to-tenant migration to aid with planning π.
I put together the PowerShell script below, which outputs a list of all Flows along with their state (enabled or disabled) and the connectors that they use to a CSV file.
This script requires the Power Platform Administrators PowerShell module to be installed, instructions on how to install this can be found here. Simply update the $FilePath variable (which sets the location to write the CSV file to) and then you are good to goπ.
$FilePath = "D:\FlowsExport.csv"
$Flows = Get-AdminFlow
"Name" + "," + "Enabled" + "," + "Connectors" | Out-File $FilePath
ForEach ($Flow in $Flows)
{
$FlowInfo = Get-AdminFlow -FlowName $Flow.FlowName -EnvironmentName $Flow.EnvironmentName
$Connectors = $FlowInfo.Internal.properties.connectionReferences
$ConnectorDetails = ""
$Connectors.PSObject.Properties | ForEach {
$ConnectorDetails += $_.Value.DisplayName + " | "
}
($Flow.DisplayName.Replace(","," ")) + "," + $Flow.Enabled + "," + $ConnectorDetails | Out-File $FilePath -Append
}
The output looks like this (I’ve fancied it up a little in Excel):

This script can also be found on GitHub

Leave a comment