Edit

Share via


Add-PowerBIWorkspaceUser

Gives permissions to a specified user to access a Power BI workspace.

Syntax

UserEmailWithId (Default)

Add-PowerBIWorkspaceUser
    -Id <Guid>
    -UserPrincipalName <String>
    -AccessRight <WorkspaceUserAccessRight>
    [-Scope <PowerBIUserScope>]
    [<CommonParameters>]

PrincipalTypeWithId

Add-PowerBIWorkspaceUser
    -Id <Guid>
    -AccessRight <WorkspaceUserAccessRight>
    -PrincipalType <WorkspaceUserPrincipalType>
    -Identifier <String>
    [-Scope <PowerBIUserScope>]
    [<CommonParameters>]

UserEmailWithWorkspace

Add-PowerBIWorkspaceUser
    -UserPrincipalName <String>
    -AccessRight <WorkspaceUserAccessRight>
    -Workspace <Workspace>
    [-Scope <PowerBIUserScope>]
    [<CommonParameters>]

PrincipalTypeWithWorkspace

Add-PowerBIWorkspaceUser
    -AccessRight <WorkspaceUserAccessRight>
    -Workspace <Workspace>
    -PrincipalType <WorkspaceUserPrincipalType>
    -Identifier <String>
    [-Scope <PowerBIUserScope>]
    [<CommonParameters>]

Description

Grants permissions to a specified user to access a Power BI workspace using the provided inputs and scope specified. Before you run this command, make sure you log in using Connect-PowerBIServiceAccount.

Examples

Example 1

PS C:\> Add-PowerBIWorkspaceUser -Scope Organization -Id 23FCBDBD-A979-45D8-B1C8-6D21E0F4BE50 -UserEmailAddress john@contoso.com -AccessRight Admin

Parameters

-AccessRight

Permissions to assign to the user.

Parameter properties

Type:WorkspaceUserAccessRight
Default value:None
Accepted values:Member, Admin, Contributor, Viewer
Supports wildcards:False
DontShow:False
Aliases:UserAccessRight

Parameter sets

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

-Id

ID of the workspace the user should be added to.

Parameter properties

Type:Guid
Default value:None
Supports wildcards:False
DontShow:False
Aliases:GroupId, WorkspaceId

Parameter sets

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

-Identifier

Identifier of the principal to add to the group. For Apps and Groups, this will be their object identifier (GUID). For users, this can be an email address.

Parameter properties

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

Parameter sets

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

-PrincipalType

The type of the principal to add to the group.

Parameter properties

Type:WorkspaceUserPrincipalType
Default value:None
Accepted values:App, Group, User
Supports wildcards:False
DontShow:False

Parameter sets

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

-Scope

Indicates scope of the call. Individual operates against only workspaces assigned to the caller; Organization operates against all workspaces within a tenant (must be an administrator to initiate). Individual is the default.

Parameter properties

Type:PowerBIUserScope
Default value:None
Accepted values:Individual, Organization
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

-UserPrincipalName

User Principal Name (or UPN, commonly an email address) for the user whose permissions need to be added.

Parameter properties

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

Parameter sets

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

-Workspace

The workspace entity to add the user to.

Parameter properties

Type:Workspace
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Group

Parameter sets

UserEmailWithWorkspace
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
PrincipalTypeWithWorkspace
Position:Named
Mandatory:True
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.

Inputs

None

Outputs

System.Object