Remove-EntraGroupMember

Removes a member from a group.

Syntax

Remove-EntraGroupMember
      -GroupId <String>
      -MemberId <String>
      [<CommonParameters>]

Description

The Remove-EntraGroupMember cmdlet removes a member from a group in Microsoft Entra ID. Specify the ObjectId and MemberId parameters to remove a member from a group.

Examples

Example 1: Remove a member

Connect-Entra -Scopes 'GroupMember.ReadWrite.All'
$group = Get-EntraGroup -Filter "DisplayName eq 'HelpDesk Team Leaders'"
$groupMember = Get-EntraGroup -GroupId $group.Id | Get-EntraGroupMember | Where-Object {$_.displayName -eq 'Adele Vance'}
Remove-EntraGroupMember -GroupId $group.Id -MemberId $groupMember.Id

This command removes the specified member from the specified group.

  • GroupId - Specifies the object ID of a group in Microsoft Entra ID.

  • MemberId - Specifies the ID of the member to remove.

Parameters

-GroupId

Specifies the object ID of a group in Microsoft Entra ID.

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

-MemberId

Specifies the ID of the member to remove.

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