Get-​Msol​Group​Member

Retrieves members of the specified group.

Syntax

Get-MsolGroupMember
   [-All]
   [-GroupObjectId <Guid>]
   [-SearchString <String>]
   [-TenantId <Guid>]
   [-MemberObjectTypes <String[]>]
   [<CommonParameters>]
Get-MsolGroupMember
   [-GroupObjectId <Guid>]
   [-MaxResults <Int32>]
   [-SearchString <String>]
   [-TenantId <Guid>]
   [-MemberObjectTypes <String[]>]
   [<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 74d7b44e-6811-4250-bffe-8292e3b0b689

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

Required 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
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-GroupObjectId

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

Type:Guid
Position:Named
Default value:None
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
Accept pipeline input:False
Accept wildcard characters:False
-MemberObjectTypes

Specifies an array of member object types.

Type:String[]
Position:Named
Default value:None
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
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
Accept pipeline input:True (ByPropertyName)
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 type (SecurityGroup, Distributionlist, or MailEnabledSecurityGroup).

* ObjectId. The unique ID of the group.