How to change owner powershell for powerautomate application

Ciaervo

Change the owner of a Power Automate workflow using PowerShell

January 10, 2022

tags: powerautomate powerplatform m365 

How to change owner powershell for powerautomate application

The old owner will get viewer access to the app but you can get it changed if required. For other Powershell cmdlets for PowerApps & flow refer this article from Microsoft.

PowerShell Tip:

To get help on any Power shell cmdlet, type Get-Help cmdletname (e.g get-help Set-AdminPowerAppOwner). To get some examples type get-help Set-AdminPowerAppOwner -examples

PowerApps for Admin Connector in Flow:

There is a preview action by the name “Set App Owner” under the connector PowerApps for admin which also helps you to change the owner of the PowerApp

How to change owner powershell for powerautomate application

PowerApps for Admin Connector in PowerApp:

The same connector used in the flow can also be used in PowerApp to change the owner for the powerapp. There is a Powerapps tool Connector Browser Tool from Microsoft to test the PowerApps for Admin connector which can be used to change the Owner of the app. The app is available as a package for download from this link, the link to the blogpost from Microsoft. You can select any actions, after entering values for the parameters click Submit.

How to change owner powershell for powerautomate application

You can test connector for Flow as well on this tool.

Assign a new Owner to a Power Automate Flow:

A new Owner can be assigned to an existing Power Automate flow by using the

  1. PowerShell cmdlets for Makers & Admins
  2. Power Automate Admin Center

Assign an Owner for a Flow created by an user who has left Organization by using PowerShell:

After installing the PowerShell module for PowerApps cmdlet for Administrators, enter the following command to get the Object ID of the user who created the flow

Connect-AzureAD
Get-AzureADUser -ObjectID  | Select-Object ObjectId

Establish a connection to use the Power cmdlets by entering the following command which opens a prompt to collect credentials (Azure Active Directory account and password of Power Platform Administrator or Global Admin)

Add-PowerAppsAccount

After copying the ObjectId of the user, enter the following PowerShell command Get-AdminFlow to get all the flows created by the user

Get-AdminFlow -CreatedBy userObjectId

The above command provides you the information of the Flow details. Copy the FlowName in GUID format and EnvironmentName. Now to assign a new Owner, enter the Set-AdminFlowOwnerRole command after changing the userObjectId, flowNameGUID and the environmentGUID

Set-AdminFlowOwnerRole -PrincipalType User -PrincipalObjectId userObjectId -RoleName CanEdit -FlowName flowNameGUID -EnvironmentName environmentGUID

If you get a 200 OK then the new owner is assigned to the Flow. You can also remove an Owner by the following command, the only catch is you will not be able to remove the creator of the flow

Remove-AdminFlowOwnerRole

Get-AdminFlowOwnerRole

Assign an Owner for a Flow created by an user who has left Organization by using the Admin Center:

This can be done by connecting to the Flow Admin center, click the environment which has the flow

How to change owner powershell for powerautomate application

Click resources & then click Flows

How to change owner powershell for powerautomate application

Then look for the flow which needs the update, click the flow & click Manage sharing to add Owner

How to change owner powershell for powerautomate application

You can also export the flow as a package & then recreate it to have a new Owner. Follow this blogpost from Microsoft.

Summary: On this post, I’ve covered different ways to update the owner for PowerApps & Flow using Powershell & Admin connector in Flow & PowerApps. Hope you find this post useful & informational. Let me know if there is any comments or feedback below.

Published by Mohamed Ashiq Faleel

Developer/architect specialized in SharePoint & Power Platform Solution Architecture and involved in SharePoint since the year 2010. Passionate about different services in Microsoft 365 & Azure. View all posts by Mohamed Ashiq Faleel

Published May 18, 2020April 6, 2021

How do I change ownership of Power Automate flow?

In this article.
Sign in to Power Automate..
On the left pane, select Solutions..
Select the solution that contains the flow you want to change..
Select the flow for which you're changing the owner..
In the Details section, select Edit..
In the Owner section, remove the current owner..
Enter the email address of the new owner..

How do I change the owner of a flow in PowerShell?

You can change the owner of a Flow if you are the creator of the Flow or if you have Global Admin privileges in the tenant. Copy the Environment and FlowName properties to variables. Also, you can use PowerShell to disable or enable flows, which can help if the above commands do not work as expected.

Can we change owner in power apps?

On the other hand, if the owner of the app left without adding a co-owner, an admin can change the owner using PowerShell. First, you will need Tenant Admin/Power Platform admin access. You will also need the Environment Id (envId) and App Id (appId). You will also need to specify the user Id.

How to change the owner of a connection reference in powerapps?

Workaround.
Open the Connection Reference that you wish to modify. Hint: Filter by Owner to get to your reference quickly if you have many to search through..
Click on Edit..
Select the Dropdown with the existing Connection and re-point it to an existing valid Connection or create a new one..