Remove-EntraGroupMember
Removes a member from a group.
Syntax
Default (Default)
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.
Parameter properties
Type: | System.String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | ObjectId |
Parameter sets
(All)
Position: | Named |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
-MemberId
Specifies the ID of the member to remove.
Parameter properties
Type: | System.String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.