Views:

Applies to Product- Power Automate

What’s happening?

Change the ownership of multiple flows without manually clicking through each flow.


Resolution:

  1. Ensure that the necessary PowerShell modules are installed, including the AzureAD module and the Microsoft.PowerApps.Administration module.
  2. 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"
    }
  3. Replace YourEnvironmentID, OldOwnerID, and NewOwnerID with the actual IDs.
  4. It is recommended to first add the new user as a co-owner to ensure no interruption occurs during the ownership transfer.
  5. After changing the ownership, manually recreate the connections for the flows to ensure they work as expected.
For further details, refer to the documentation on changing cloud flow ownership.