How to change the owner of PowerApps

I have seen many blog posts and videos about how to change the owner of a PowerApp. The problem is that all the blogs posts out there (as of 4/21/2020) don't tell you how to change the owner to someone other than the Global Administrator running these commands. Some blogs just tell you there is a command which is supremely unhelpful. So I plan to fix that.

Q: Why would you change it?
A: In case someone created an app that left the company you want to transfer it. Or perhaps you created the app and you want to transfer ownership of it to a Service Account that will live beyond you.

Q: Why not just use the Export/Import process?
A: You can, but that is not the point of this article.


What you need

1) An Office 365 Global Administrator account and access to Azure Active Directory users portal
2) The App ID and Environment ID (more below)
3) PowerShell

Get the details

1) In a browser, login to admin.powerapps.com as a Global Administrator
2) In the Environments, select your Environment name
3) Select the Resources link and find the App want to transfer to a new owner and click on it


4) From the details screen URL you can obtain the App ID and Environment ID. For example the Environment ID will be after /environments/ and the App ID will be after /apps/. These are color coded in the example below. Copy these to Notepad or other text editor

https://admin.powerapps.com/environments/Default-b96ec01a-4e9e-4e5e-b216-f74187681f6b/resources/apps/a6f2e4c5-af2c-4ef4-8c5c-beb9bdb74efd/details


5) Ge the new owner's Object ID form the Azure AD Portal > Users > New Owner. In this case, my user is named "A Test User".


Copy the Object ID and save it to your Notepad or other text editor

6) Compose your PowerShell Script with the following template

Set-AdminPowerAppOwner -AppName 'AppID' -AppOwner 'Object ID' -EnvironmentName 'Environment ID'

My example would be
Set-AdminPowerAppOwner -AppName 'a6f2e4c5-af2c-4ef4-8c5c-beb9bdb74efd' -AppOwner 'a6ba8d8e-19c0-488b-9e20-d6cf2f76cecf ' -EnvironmentName 'Default-b96ec01a-4e9e-4e5e-b216-f74187681f6b'


Change Ownership with PowerShell

1) Run PowerShell as an administrator
2) Install the following PowerShell modules if you have not already
Install-Module -Name Microsoft.PowerApps.Administration.PowerShell
Install-Module -Name Microsoft.PowerApps.PowerShell -AllowClobber
3) Connect to PowerApps by entering Get-PowerApp
This will ask you to login to your tenant. Again, this should be a Global Admin

4) Copy and past your command. My example

Set-AdminPowerAppOwner -AppName 'a6f2e4c5-af2c-4ef4-8c5c-beb9bdb74efd' -AppOwner 'a6ba8d8e-19c0-488b-9e20-d6cf2f76cecf ' -EnvironmentName 'Default-b96ec01a-4e9e-4e5e-b216-f74187681f6b'

Done! The app is now owned by the new owner. You can reload the page in the PowerApps Admin Center > Resources > Apps to verify the owner was changed.


Popular posts from this blog

Unknown server tag 'AdminControls:MigrationToolPromotionTip'.

SharePoint 2013 Site Owner cannot manage Access Requests (Updated)