Enabling or Disabling Power Platform Features using PowerShell

Loading

Power Platform provides administrators with the ability to enable or disable various features to optimize performance, security, and governance. Using PowerShell, you can automate this process across Power Apps, Power Automate, Dataverse, and Power Platform environments.

This guide will cover:
Connecting to Power Platform Admin Center using PowerShell
Listing all available Power Platform features
Enabling or disabling specific features
Checking the status of a feature
Automating feature configuration using scripts


Step 1: Prerequisites

1. Install Power Platform PowerShell Modules

If not installed, run:

Install-Module -Name Microsoft.PowerPlatform.Administration -Scope CurrentUser -Force
Install-Module -Name Microsoft.PowerApps.Administration.PowerShell -Scope CurrentUser -Force

2. Connect to Power Platform Admin Center

Run the following command and log in with admin credentials:

Add-PowerAppsAccount

Now you’re connected!


Step 2: List Available Power Platform Features

To check all available features in a specific environment:

Get-AdminPowerAppEnvironment -EnvironmentName "Default-12345" | Format-List

This will display environment details, including enabled/disabled features.


Step 3: Enable or Disable a Power Platform Feature

Example 1: Enable or Disable Developer Environments

To disable Developer Environments (sandbox environments for Power Apps development):

Set-TenantSettings -IsAllowingDeveloperEnvironment $false

To enable them:

Set-TenantSettings -IsAllowingDeveloperEnvironment $true

Developer environments setting updated!


Example 2: Enable or Disable Dataverse Auditing

To enable Dataverse auditing:

Set-AdminPowerAppEnvironment -EnvironmentName "Default-12345" -IsAuditEnabled $true

To disable it:

Set-AdminPowerAppEnvironment -EnvironmentName "Default-12345" -IsAuditEnabled $false

Dataverse auditing configured!


Example 3: Enable or Disable Power Automate Execution

To disable Power Automate flows from running:

Set-AdminPowerAppEnvironment -EnvironmentName "Default-12345" -IsFlowEnabled $false

To enable flows again:

Set-AdminPowerAppEnvironment -EnvironmentName "Default-12345" -IsFlowEnabled $true

Power Automate execution updated!


Example 4: Enable or Disable Data Export in Dataverse

To disable users from exporting data from Dataverse:

Set-AdminPowerAppEnvironment -EnvironmentName "Default-12345" -IsDataExportAllowed $false

To enable data export:

Set-AdminPowerAppEnvironment -EnvironmentName "Default-12345" -IsDataExportAllowed $true

Dataverse data export restriction configured!


Example 5: Enable or Disable AI Builder Features

To disable AI Builder in Power Platform:

Set-TenantSettings -IsAICapabilitiesEnabled $false

To enable AI Builder:

Set-TenantSettings -IsAICapabilitiesEnabled $true

AI Builder settings updated!


Step 4: Check the Status of a Feature

To verify if Power Automate is enabled:

(Get-AdminPowerAppEnvironment -EnvironmentName "Default-12345").IsFlowEnabled

To check if Dataverse auditing is enabled:

(Get-AdminPowerAppEnvironment -EnvironmentName "Default-12345").IsAuditEnabled

Feature status verified!


Step 5: Automate Feature Configuration

To disable multiple features at once, use this script:

$envName = "Default-12345"

# Disable multiple features
Set-AdminPowerAppEnvironment -EnvironmentName $envName -IsFlowEnabled $false -IsAuditEnabled $false -IsDataExportAllowed $false

Write-Host "Power Platform features disabled successfully!"

Feature automation configured!

Leave a Reply

Your email address will not be published. Required fields are marked *