ערוך

שתף באמצעות


Add-MsolRoleMember

Adds a member to an administrator role.

Syntax

Add-MsolRoleMember
   -RoleObjectId <Guid>
   [-RoleMemberType <RoleMemberType>]
   [-RoleMemberObjectId <Guid>]
   [-RoleMemberEmailAddress <String>]
   [-TenantId <Guid>]
   [<CommonParameters>]
Add-MsolRoleMember
   [-RoleMemberType <RoleMemberType>]
   [-RoleMemberObjectId <Guid>]
   [-RoleMemberEmailAddress <String>]
   -RoleName <String>
   [-TenantId <Guid>]
   [<CommonParameters>]

Description

The Add-MsolRoleMember cmdlet is used to add a member to an administrator role. Currently, only users and service principals can be added to a role. Adding a security group is not supported.

Examples

Example 1: Add a member to an administrator role

PS C:\> Add-MsolRoleMember -RoleName "Company Administrator" -RoleMemberEmailAddress "elisadaugherty@contoso.com"

This command adds elisadaugherty@contoso.com to the Company Administrator role. To get the list of values for the RoleName parameter, use the Get-MsolRole cmdlet.

Parameters

-RoleMemberEmailAddress

Specifies the member to add. Specify either the RoleMemberEmailAddress or RoleMemberObjectId parameter.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-RoleMemberObjectId

Specifies the unique object ID of the member to add. Specify either RoleMemberEmailAddress or RoleMemberObjectId.

Type:Guid
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-RoleMemberType

Specifies the type of role of the member to add. Valid values are: User and ServicePrincipal. Group is not currently supported.

Type:RoleMemberType
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-RoleName

Specifies the name of the role to which to add members. Specify either the RoleName or RoleObjectId parameter.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-RoleObjectId

Specifies the unique ID of the role to which to add members. Specify either RoleName or RoleObjectId.

Type:Guid
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-TenantId

Specifies the unique ID of the tenant on which to perform the operation. The default value is the tenant of the current user. This parameter applies only to partner users.

Type:Guid
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False