Remove-EntraGroupMember
从组中删除成员。
语法
Default (默认值)
Remove-EntraGroupMember
-GroupId <String>
-MemberId <String>
[<CommonParameters>]
说明
该 Remove-EntraGroupMember cmdlet 从Microsoft Entra ID中的组中删除成员。 指定要从组中删除成员的 ObjectId 和 MemberId 参数。
示例
示例 1:删除成员
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
此命令从指定组中删除指定的成员。
GroupId- 指定Microsoft Entra ID中组的对象 ID。MemberId- 指定要删除的成员的 ID。
参数
-GroupId
指定Microsoft Entra ID组中的对象 ID。
参数属性
| 类型: | System.String |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
| 别名: | 对象标识符 (ObjectId) |
参数集
(All)
| Position: | Named |
| 必需: | True |
| 来自管道的值: | True |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-MemberId
指定要删除的成员的 ID。
参数属性
| 类型: | System.String |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | True |
| 来自管道的值: | True |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
CommonParameters
此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters。