Enable-Identity

Enables identity for a Power Platform environment by linking it to an enterprise policy.

Syntax

Default (Default)

Enable-Identity
    [-EnvironmentId] <String>
    [-PolicyArmId] <String>
    [[-TenantId] <String>]
    [[-Endpoint] <PPEndpoint>]
    [[-AzureEnvironment] <AzureEnvironment>]
    [-ForceAuth]
    [-Swap]
    [-NoWait]
    [[-TimeoutSeconds] <Int32>]
    [<CommonParameters>]

Description

The Enable-Identity cmdlet links an existing identity enterprise policy to a Power Platform environment, enabling the environment to use the system-assigned managed identity configured in the policy.

If the environment already has a different identity policy linked, use the -Swap switch to replace it. Without -Swap, the cmdlet returns an error to prevent accidental policy replacement.

The operation is asynchronous. By default, the cmdlet waits for the operation to complete. Use -NoWait to return immediately after the operation is initiated.

Examples

EXAMPLE 1

Enable-Identity -EnvironmentId "00000000-0000-0000-0000-000000000000" -PolicyArmId "/subscriptions/aaaabbbb-0000-cccc-1111-dddd2222eeee/resourceGroups/myResourceGroup/providers/Microsoft.PowerPlatform/enterprisePolicies/myPolicy"

Enables identity for the environment by linking it to the specified policy.

EXAMPLE 2

Enable-Identity -EnvironmentId "00000000-0000-0000-0000-000000000000" -PolicyArmId "/subscriptions/.../enterprisePolicies/myPolicy" -Endpoint usgovhigh

Enables identity for an environment in the US Government High cloud.

EXAMPLE 3

Enable-Identity -EnvironmentId "00000000-0000-0000-0000-000000000000" -PolicyArmId "/subscriptions/.../enterprisePolicies/newPolicy" -Swap

Replaces the existing identity policy with a new one.

EXAMPLE 4

Enable-Identity -EnvironmentId "00000000-0000-0000-0000-000000000000" -PolicyArmId "/subscriptions/.../enterprisePolicies/myPolicy" -NoWait

Initiates the link operation without waiting for completion.

Parameters

-AzureEnvironment

The Azure environment to use

Parameter properties

Type:AzureEnvironment
Default value:AzureCloud
Accepted values:AzureCloud, AzureChinaCloud, AzureUSGovernment, EastUs2Euap, CentralUSEuap
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:5
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Endpoint

The Power Platform endpoint to connect to. Defaults to 'prod'.

Parameter properties

Type:PPEndpoint
Default value:Prod
Accepted values:unknown, tip1, tip2, prod, usgovhigh, dod, china
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:4
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-EnvironmentId

The Power Platform environment ID

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ForceAuth

Force re-authentication instead of reusing existing session

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-NoWait

Return immediately without waiting for the operation to complete

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PolicyArmId

The full Azure ARM resource ID of the Identity Enterprise Policy

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:2
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Swap

Replace an existing linked policy with the new one

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-TenantId

The Entra tenant ID

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:3
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-TimeoutSeconds

Maximum time in seconds to wait for the operation to complete

Parameter properties

Type:Int32
Default value:600
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:6
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Outputs

System.Boolean

Returns $true when the operation completes successfully, or when -NoWait is specified and the operation is initiated.