PowerApps : Force Ownership to another user

 If you have a Powerapp that is offline due to a owner that has left, you need to take control of the application, lets get started

Then you need to get the modules:

Install-Module -Name Microsoft.PowerApps.Administration.PowerShell
Install-Module -Name Microsoft.PowerApps.PowerShell -AllowClobber

Then connect to the platform:

# This call opens prompt to collect credentials (Azure Active Directory account and password) used by
the commands 

Then the commands you need is this:

Set-AdminPowerAppOwner -AppName '<appid>' -AppOwner '<ownerid>' -EnvironmentName '<environmentGUID>'

Get the EnvironmentName

Once you have the environment that the powerapp is located in, which you can do from ther Powerapp admin centre : https://admin.powerplatform.microsoft.com/

Once you find the environment ID which you can get from the main environment screen, its in the red box below: 

Get the AppID

From the top menu bar you need to click Resources then Power Apps as below:

Search for the name of the application, this is the "actual" name once you locate it, click on the tree dots then details.....

This will then show you the app ID at the bottom of the details pane, this is the last entry.

Get the OwnerID

Now the last piece of the puzzle is the OwnerID, to get this login to the azure portal from this > https://portal.azure.com then pop yourself in AAD, then to users, then search for your account, on the main page you get the Object ID as shown below:

You now have the last piece of the puzzle, you can now complete the command and make yourself the owner and find out why the app is not working, so for this example the completed command would be :

Set-AdminPowerAppOwner -AppName '97b36a25-ad68-4643' -AppOwner '1a38222f-519b' -EnvironmentName 'default-e15c1e99-7be3-495c'

When you run this, powershell will return no errors at all, like this, then when you check in the portal the GUID specified will now be the owner of the app.

Code        :
Description :
Headers     :
Error       :
Errors      :
Internal    : @{name=97b36a25-ad68-4643-a62a-d47394a1b241;
              type=Microsoft.PowerApps/apps; tags=; properties=; appLocation=pluto; appType=ClassicCanvasApp}

Previous Post Next Post

Ω†Ω…ΩˆΨ°Ψ¬ Ψ§Ω„Ψ§ΨͺΨ΅Ψ§Ω„