Κοινή χρήση μέσω


Get started using the Power Apps admin module

The Power Apps admin (Microsoft.PowerApps.Administration.PowerShell) PowerShell module is used to administer apps and environments in the Power Platform admin center.

This module works with Microsoft Dataverse.

You can install this module directly from the PowerShell Gallery.

  1. Start a PowerShell session.
  2. Enter the following cmdlet.
Install-Module -Name Microsoft.PowerApps.Administration.PowerShell <current version>

Establish your credentials

To establish your credentials so you aren't continuously prompted for them while you run Power Apps administration module cmdlets, use either a service principal (recommended) or pass them by specifying your user name and secure string password.

Important

A service principal is required when you use multi-factor authentication (MFA).

Use a service principal

The following example shows you how to establish credentials by using a client ID and secret. For information about how to create the service principal that's required for this, go to Creating a service principal application using PowerShell.

$appId = "CLIENT_ID_FROM_AZURE_APP"
$secret = "SECRET_FROM_AZURE_APP"
$tenantId = "TENANT_ID_FROM_AZURE_APP"
Add-PowerAppsAccount -Endpoint prod -TenantID $tenantId -ApplicationId $appId -ClientSecret $secret -Verbose

Use user name and password

The following example shows you how to use a plain text password converted to a secure string to establish credentials that can be used during a PowerShell session to run Power Apps administration module commands.

$plainTextPassword = “My password”
$secureString = ConvertTo-SecureString $plainTextPassword -AsPlainText -Force
Add-PowerAppsAccount -Endpoint prod -Username user@orgname.onmicrosoft.com -Password $secureString

Get help for cmdlets

You can get help for any cmdlet using the following command:

Get-Help cmdletname

For example, to get help on the Backup-PowerAppEnvironment cmdlet:

Get-Help Backup-PowerAppEnvironment

Next steps

To view the Power Apps administration module cmdlet reference, go to Microsoft.PowerApps.Administration.PowerShell Module