Skip to content

Commit eeb9097

Browse files
Update Get users who create most flows.md
1 parent 8a760d2 commit eeb9097

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

articles/English/PowerPlatform/Get users who create most flows.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,21 @@ Managing your flows using PnP is fabulously easy. Faster to code than CSOM, more
1717
## Get Flow Properties
1818

1919
First, retrieve properties of the flow. Remember to use -AsAdmin switch. Otherwise you will get only your own flows.
20+
```
2021
Connect-PnpOnline
2122
$environment = Get-PnPPowerPlatformEnvironment
2223
$Flows = Get-PnPFlow -Environment $environment -AsAdmin | select -expandProperty Properties
23-
24+
```
2425

2526

2627
One of those properties is the Creator. If you expand it, you obtain ObjectId, which is Azure Active Directory ObjectId.
2728

2829

2930

30-
Using Group-Object and Sort-Object cmdlets, you get the users who created most flows.
31+
Using ```Group-Object``` and ```Sort-Object``` cmdlets, you get the users who created most flows.
32+
```
3133
$props.Creator | Group-Object -Property ObjectId -NoElement | Sort-Object -Descending
32-
34+
```
3335

3436

3537

@@ -38,13 +40,14 @@ $props.Creator | Group-Object -Property ObjectId -NoElement | Sort-Object -Desc
3840

3941

4042
Use Azure Active Directory ObjectId to obtain user's UPN or email address.
43+
```
4144
Connect-MSOLService
4245
Get-MsolUser | where {$_.ObjectId -eq "f655dd56-ffea-45ad-aa45-775e4e0eeb9b"}
43-
46+
```
4447

4548

4649
## Full Script
47-
50+
```
4851
Connect-PnPOnline
4952
$environment = Get-PnPPowerPlatformEnvironment
5053
$flowprops = Get-PnPFlow -AsAdmin -Environment $environment | select -ExpandProperty Properties
@@ -59,7 +62,7 @@ $MostProlific | Foreach-Object {
5962
Write-Host $user.DisplayName $user.NoOfFlow
6063
$user | Export-CSV -Path yourcsvpath.csv -Append
6164
}
62-
65+
```
6366

6467

6568

0 commit comments

Comments
 (0)