Muokkaa

Jaa


Add-MsolGroupMember

Adds a member to an existing security group.

Syntax

Add-MsolGroupMember
   -GroupObjectId <Guid>
   [-GroupMemberType <GroupMemberType>]
   [-GroupMemberObjectId <Guid>]
   [-TenantId <Guid>]
   [<CommonParameters>]

Description

The Add-MsolGroupMember cmdlet adds members to a security group. The new members can be either users or other security groups.

Examples

Example 1: Add a user to a security group

PS C:\> Add-MsolGroupMember -GroupObjectId aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb -GroupMemberType User -GroupMemberObjectId bbbbbbbb-1111-2222-3333-cccccccccccc

This command adds a user to a security group.

Parameters

-GroupMemberObjectId

Specifies the unique object ID of the user or group to add to the group.

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

-GroupMemberType

Specifies the type of member to add to the group. Valid values are: User and Group.

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

-GroupObjectId

Specifies the unique ID of the group to which to add members.

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