Applies to Product- Power Automate
What’s happening?
Change the ownership of multiple flows without manually clicking through each flow.
Resolution:
- Ensure that the necessary PowerShell modules are installed, including the AzureAD module and the Microsoft.PowerApps.Administration module.
- Use the following PowerShell script to change the flow owner:
powershell Connect-AzureAd $env = "YourEnvironmentID"
$flows = Get-AdminFlow -EnvironmentName $env -CreatedBy "OldOwnerID"
foreach ($flow in $flows) {
Set-AdminFlowOwnerRole -EnvironmentName $env -FlowName $flow.FlowName -RoleName "Owner" -PrincipalType "User" -PrincipalObjectId "NewOwnerID"
} - Replace YourEnvironmentID, OldOwnerID, and NewOwnerID with the actual IDs.
- It is recommended to first add the new user as a co-owner to ensure no interruption occurs during the ownership transfer.
- After changing the ownership, manually recreate the connections for the flows to ensure they work as expected.
