I need to get a list of all flows in our tenant. Got this script going the only issue i am running into is that I can't figure out how to list the site and list name that the flow is attached to. Any help would be great.
#Get all flows.
Write-Host "Report is being generated" -BackgroundColor Red
Get-AdminFlow |
ForEach-Object { $user = Get-UsersOrGroupsFromGraph -ObjectId $_.CreatedBy.userId;
$createtime = Get-Date -Date $_.CreatedTime -Format "MM/dd/yyyy";
$lasttime = Get-Date -Date $_.LastModifiedTime -Format "MM/dd/yyyy";
[PSCustomObject]@{
FlowName = $_.DisplayName;
OwnerName = $user.DisplayName ;
OwnerEmail = $user.UserPrincipalName ;
Enabled = $_.Enabled ;
CreatedTime = $createtime;
LastModifed = $lasttime;
};} |
Export-Csv -Path "C:\PS1\Reports\AllFlows $(get-date -f MM-dd-yyyy).csv" -NoTypeInformation
Write-Host "Report is created" -BackgroundColor Green