Get started using the online management API module

Important

The online management API PowerShell module is deprecated. The online management API PowerShell module will be updated in October, 2020 to point to newer underlying APIs and won’t receive further updates. We recommend that you use the Power Apps administration module. More information: Get started using the Power Apps admin module

The online management API (Microsoft.Xrm.OnlineManagementAPI) PowerShell module is used to manage Common Data Service environments.

This module works with Common Data Service.

You can install this module directly from the PowerShell Gallery.

  1. Start a PowerShell session.
  2. Enter the following cmdlet.
install-module Microsoft.Xrm.OnlineManagementAPI

Establish your credentials and connection

To establish your credentials, run the following commands, where $user is your user account (UNC) and $password is your Office 365 tenant password.

$user = "admin@sfa.contoso.onmicrosoft.com"
$password = "password"
$cred = New-Object System.Management.Automation.PSCredential ($user, (ConvertTo-SecureString $password –ASPlainText –Force))

To save your connection ApiUrl, run the following cmdlet, where $connectionhost is the root service url of your environment region. More information: Service URL

$connectionhost = "https://admin.services.crm.dynamics.com"

You can get help on any cmdlet. Get-Help cmdletname

For example, get help on the Backup-CrmInstance cmdlet Get-Help Backup-CrmInstance

Breaking changes with version 2.0+

As part of the deprecation of the module in October, 2020, we will be making one final update to route the backend API calls from this module to newer Power Platform APIs. To that end, some commands will no longer function or will return values in a slightly different format than they had previously. A list of these changes is below.

Commandlet Notes
New-CrmManagementApp Id property will now always be equal to the AadApplicationId property.
Get-CrmManagementApp Id property will now always be equal to the AadApplicationId property.
Get-CrmManagementApps Applications are always enabled. To disable you can delete the application.
Enable-CrmManagementApp Action is no longer supported.
Disable-CrmManagementApp Action is no longer supported.
Add-CrmFlightAudience Action is no longer supported.
Get-CrmFlights Action is no longer supported.
Remove-CrmFlightAudience Action is no longer supported.
Get-CrmLanguages Name and LocalizedName values are minimally changed from prior versions.
Get-CrmCurrencies Response values are significantly changed from prior versions.
Get-CrmInstanceTypes The backend API is based on consumption model instead of slot model. Values of each instance type will differ from prior versions.
Get-CrmInstanceType The backend API is based on consumption model instead of slot model. Values of each instance type will differ from prior versions.

See also

Get started using the Power Apps admin module
Microsoft.Xrm.OnlineManagementAPI Module Reference
Overview