Add-MsolRoleMember

Adds a member to an administrator role.

Syntax

Add-MsolRoleMember [-RoleMemberEmailAddress <String>] [-RoleMemberObjectId <Guid>]
 [-RoleMemberType <RoleMemberType>] -RoleName <String> [-TenantId <Guid>] [<CommonParameters>]
Add-MsolRoleMember [-RoleMemberEmailAddress <String>] [-RoleMemberObjectId <Guid>]
 [-RoleMemberType <RoleMemberType>] -RoleObjectId <Guid> [-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
Required:False
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

-RoleMemberObjectId

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

Type:Guid
Required:False
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
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
Required:False
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
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
Required:True
Position:Named
Default value:None
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
Required:True
Position:Named
Default value:None
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
Required:False
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False