web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Export All cloud flows...
Power Automate
Unanswered

Export All cloud flows in my organization with last execution time

(1) ShareShare
ReportReport
Posted on by 2
I have to check the last execution time of all the cloud flows in my organization. Currently, I can use "Get-Adminflow" command in PowerShell to export all flows in my org. However, the output of this command only show columns like FlowName, CreateTime, CreateBy that can't meet my requirement. Due to this issue, I use another PowerShell command, Get-FlowRun, to retrieve the last execution record of every flow in my org. However, after I use this command, I can only see the last execution time and status of the flows that I owe and others share with me, other flows of these two columns remain empty.
Besides, I have the Power Platform administrator authority and Power Automate Premium for my account
Is there any suggestion that how can I fix this issue? Thanks a lot.
 
My PowerShell command:
Import-Module Microsoft.PowerApps.Administration.PowerShell
Connect-AzureAD
Add-PowerAppsAccount
$flows = Get-AdminFlow
$detailedFlows = @()
foreach ($flow in $flows) {
    $ADUser = $null
    try {
        $ADUser = (Get-AzureADUser -ObjectId $flow.CreatedBy.userId)
    }
    catch {
        Write-Warning "User not found for ObjectId: $($flow.CreatedBy.userId)"
    }
    if ($ADUser) {
        $lastRun = (Get-FlowRun -EnvironmentName $flow.EnvironmentName -FlowName $flow.FlowName | Sort-Object -Property StartTime -Descending | Select-Object -First 1)
        $detailedFlows += [PSCustomObject]@{
            flowName = $flow.DisplayName
            creatorID = $ADUser.UserPrincipalName.Substring(0, 6)
            creatorName = $ADUser.DisplayName
            creatorDept = $ADUser.Department
            modifiedTime = $flow.LastModifiedTime
            lastExecutionTime = $lastRun.StartTime
            status = $lastRun.Status
            enable = $flow.Enabled
        }
    }  
}
$detailedFlows | Export-Csv -Path "../flow_detail.csv" -Encoding UTF8
Categories:
I have the same question (1)
  • Suggested answer
    ankit_singhal Profile Picture
    590 Super User 2025 Season 2 on at
    You should use any service account for this activity. Service account should be owner of all flow or you can share all flow with you as well if there is no impact.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 463 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 427 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard