Muokkaa

Jaa


Get-MsolGroupMember

Retrieves members of the specified group.

Syntax

Get-MsolGroupMember
   [-GroupObjectId <Guid>]
   [-MemberObjectTypes <String[]>]
   [-SearchString <String>]
   [-MaxResults <Int32>]
   [-TenantId <Guid>]
   [<CommonParameters>]
Get-MsolGroupMember
   [-GroupObjectId <Guid>]
   [-MemberObjectTypes <String[]>]
   [-SearchString <String>]
   [-All]
   [-TenantId <Guid>]
   [<CommonParameters>]

Description

The Get-MsolGroupMember cmdlet gets members of the specified group. The members can be either users or groups.

Examples

Example 1: Get all members of a group

PS C:\> Get-MsolGroupMember -GroupObjectId aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb

This command retrieves all members of the specified group. The members can be users or groups.

Parameters

-All

Indicates that this cmdlet returns all results that it finds. Do not specify this parameter and the MaxResults parameter.

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

-GroupObjectId

Specifies the unique ID of the group from which to get members.

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

-MaxResults

Specifies the maximum number of results that this cmdlet returns. The default value is 250.

Type:Int32
Position:Named
Default value:250
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-MemberObjectTypes

Specifies an array of member object types.

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

-SearchString

Specifies a string. This cmdlet returns objects with a display name or email address that start with this string.

Type:String
Position:Named
Default value:None
Required:False
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

Outputs

Microsoft.Online.Administration.GroupMember

This cmdlet returns objects that contain the following information:

  • CommonName. The common name of the group.

  • DisplayName. The display name of the group.

  • EmailAddress. The primary email address of the group (for MailEnabled groups only).

  • GroupMemberType. The group member type (User, ServicePrincipal, Contact, or Group).

  • ObjectId. The unique ID of the group.