Skip Ribbon Commands
Skip to main content

Quick Launch

Todd Klindt's home page > Todd Klindt's Office 365 Admin Blog > Posts > How to use PowerShell to Find all the Flows in Your Tenant
July 15
How to use PowerShell to Find all the Flows in Your Tenant

I have a OneNote file that is full of blog posts that seemed like a great idea at the time, but never saw the light of day for various reasons. Maybe I couldn’t research it as much as I wanted, maybe I couldn’t make it as thorough as I wanted, maybe I just got distracted by something shiny. This blog post is one of them. I was never confident enough to post this one, but given all the Workflow excitement, and a couple of customer requests I decided to dig in and get serious about it. So here it is, two years after I first took the notes for it.

As an administrator, I find myself frustrated a lot by the lack, or at least lack of understanding on how to manage Flows and Power Apps. They never quite behave exactly like I want them to. One of the things that keeps coming up is being able to get a list of all of the Flows in a Tenant. This could be for licensing questions, migrating questions, or just plain curiosity. Whatever it is, it’s never as easy as I want it to be. Being the fanboy of PowerShell that I am, that’s where I looked. Without boring you with a lot of story part, I’ll show you the PowerShell I settled on.

Get-AdminFlow | ForEach-Object { $user = Get-UsersOrGroupsFromGraph -ObjectId $_.CreatedBy.userId;[PSCustomObject]@{ FlowName = $_.DisplayName; OwnerName = $user.DisplayName ; OwnerEmail = $user.UserPrincipalName ; }; }

Let’s break that down a bit. You’ll need to install the PowerApps and Flow for Admins module. Install the PowerApps and Flow for Makers module while you’re at it. If you don’t run Add-PowerAppsAccount and add your Tenant Admin account you’ll get prompted for authentication the first time you run Get-AdminFlow.

Get-AdminFlow lists all of the Flows in a tenant, but not in the most user friendly way:

image

So I cleaned it up a bit. Using ForEach-Object I walk through each Flow. I use Get-UsersOrGroupsFromGraph to get the Owner object. Then I create a PSCustomObject and populate it with the Flow’s DisplayName and the user’s DisplayName and UserPrincipalName properties. It looks like this:

image

Making it an object is a little extra work as opposed to just spewing it onto the screen with Write-Host. But it’s worth the extra effort because I can send it down the pipeline and do more with it. For instance, I can easily pipe it out to a CSV file by appending | Export-Csv -Path .\Flows.csv –NoTypeInformation to the end.

image

That seems a bit anticlimactic at first, but open up that CSV file and prepare to be amazed.

image

If you want different information about each Flow, run Get-AdminFlow | Get-Member and see what other properties are exposed to you.

Let me know if this helps and what else you’d like help with.

tk

ShortURL: https://www.toddklindt.com/POSHFindAllFlows

Edit 7/15/2020 – Changed the PowerShell to be more efficient, but now it doesn’t match the screenshots.

Comments

Link to PowerShell Script

This is a bundle of awesomeness Todd!!  Do you have a link to your updated PS script?
 on 7/16/2020 7:01 PM

Re: Link to PowerShell Script

The PowerShell is in the blog post. I updated it there. I'm thinking about writing it as a function in a module, but I haven't published that yet.

tk
Todd O. KlindtNo presence information on 7/19/2020 9:01 PM

Get-AdminFlow not returning expected value

Thanks Todd for the helpful article. When I am tying Get-AdminFlow, instead of the  flows, I am getting a bunch of {}{}{} followed by a lots  of empty lines scrolled. Account I am using is a Global Admin.

Soumya
 on 9/21/2020 11:14 AM

Find flow in a Sharepoint online site

I have certain kind of sites and don't want to allow users to create flow in those site, we just want to get alert if they create any flow in these site, how can I find if there is any flow created in any site collection.
 on 1/24/2022 10:04 AM

Russian Escorts

Russian Escorts in Mumbai, Mumbai Escorts Agency, Mumbai Vip Escorts, Mumbai Russian Escorts, Russian Mumbai Escorts, Escorts in Mumbai, Independent Mumbai Escorts, Mumbai Escorts

<a href="https://mumbaiescortss.net">Russian Escorts in Mumbai, Mumbai Escorts Agency, Mumbai Vip Escorts</a>
<a href="https://mumbaiescortss.net/mumbai-escorts.html">Mumbai Escorts</a>
<a href="https://mumbaiescortss.net/russian-escorts-service-andheri.html">Russian escorts andheri</a>
<a href="https://mumbaiescortss.net/russian-escorts-service-bandra.html">Russian escorts bandra</a>
<a href="https://mumbaiescortss.net/russian-escorts-service-colaba.html">Russian escorts colaba</a>
<a href="https://mumbaiescortss.net/russian-escorts-service-juhu.html">Russian escorts juhu</a>
<a href="https://mumbaiescortss.net/russian-escorts-andheri.html">Russian escorts andheri</a>
<a href="https://mumbaiescortss.net/russian-escorts-bandra.html">Russian escorts bandra</a>
<a href="https://mumbaiescortss.net/russian-escorts-colaba.html">Russian escorts colaba</a>
<a href="https://mumbaiescortss.net/russian-escorts-juhu.html">Russian escorts juhu</a>
 on 9/5/2024 5:01 AM

Independent Call GirlService

 on 9/10/2024 2:29 AM

Roshniwalia

 on 9/10/2024 2:50 AM

bhumikajoshi

High-quality Mumbai escort services are available to meet your needs. Whether you are looking for a top model escort or a VIP experience, our professional and independent escorts are here to make your dreams come true. Contact us now to enjoy the best Russian escort services in Mumbai.
 on 9/12/2024 6:53 AM

bhumikajoshi

 on 9/12/2024 6:53 AM

Jiya Desai

 on 9/13/2024 4:08 AM
1 - 10Next

Add Comment

Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.

Title


Body *


Today's date *

Select a date from the calendar.
Please enter today's date so I know you are a real person

Twitter


Want a message when I reply to your comment? Put your Twitter handle here.

Attachments

 

 SysKit