次の方法で共有


Set-AdminPowerAppEnvironmentRoleAssignment

Sets permissions to an environment without a Dataverse database. If you make this call to an environment with a Dataverse database instance, you receive a 403 Forbidden error.

Syntax

User (Default)

Set-AdminPowerAppEnvironmentRoleAssignment
    -EnvironmentName <String>
    -RoleName <String>
    -PrincipalType <String>
    -PrincipalObjectId <String>
    [-ApiVersion <String>]
    [<CommonParameters>]

Tenant

Set-AdminPowerAppEnvironmentRoleAssignment
    -EnvironmentName <String>
    -RoleName <String>
    -PrincipalType <String>
    [-PrincipalObjectId <String>]
    [-ApiVersion <String>]
    [<CommonParameters>]

Description

The Set-AdminPowerAppEnvironmentRoleAssignment cmdlet grants security role permission, either environment admin or environment maker, for a single user, a security group, or all users in the tenant, for an environment. Use Get-Help Set-AdminPowerAppEnvironmentRoleAssignment -Examples for more detail.

Examples

EXAMPLE 1

Set-AdminPowerAppEnvironmentRoleAssignment -EnvironmentName bbbbbbbb-1111-2222-3333-cccccccccccc -RoleName EnvironmentAdmin -PrincipalType User -PrincipalObjectId aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb

Assigns the environment admin role privileges to the the user with an object id of aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb in the environment bbbbbbbb-1111-2222-3333-cccccccccccc.

EXAMPLE 2

Set-AdminPowerAppEnvironmentRoleAssignment -EnvironmentName bbbbbbbb-1111-2222-3333-cccccccccccc -RoleName EnvironmentMaker -PrincipalType Tenant

Assigns everyone environment maker role privileges in the environment bbbbbbbb-1111-2222-3333-cccccccccccc.

Parameters

-ApiVersion

Specifies the Api version that is called.

Parameter properties

Type:String
Default value:2016-11-01
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

-EnvironmentName

The environment ID.

Parameter properties

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

Parameter sets

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

-PrincipalObjectId

If this environment is being shared with a user or security group principal, this field specified the ObjectId for that principal. Use the Get-UsersOrGroupsFromGraph cmdlet to look-up the ObjectId for a user or group in Microsoft Entra ID.

Parameter properties

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

Parameter sets

User
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PrincipalType

Specifies the type of principal this environment is being shared with; a user, a security group, or the entire tenant.

Parameter properties

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

Parameter sets

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

-RoleName

Specifies the permission level given to the environment: environment admin or environment maker.

Parameter properties

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

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
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.