Remove-MsolGroupMember

從安全組中移除成員。

語法

Remove-MsolGroupMember
      -GroupObjectId <Guid>
      [-GroupMemberType <GroupMemberType>]
      [-GroupMemberObjectId <Guid>]
      [-TenantId <Guid>]
      [<CommonParameters>]

Description

Remove-MsolGroupMember Cmdlet 可用來從安全組中移除成員。 此成員可以是使用者或群組。

範例

範例 1:從群組中移除使用者

PS C:\> $GroupId = Get-MsolGroup -SearchString "MyGroup"
PS C:\> $UserId = Get-MsolUser -UserPrincipalName "evannarvaez@contoso.com"
PS C:\> Remove-MsoLGroupMember -GroupObjectId $GroupId -GroupMemberType User -GroupmemberObjectId $UserId

此範例會從名為 MyGroup 的群組中移除使用者 evannarvaez@contoso.com 。

參數

-GroupMemberObjectId

指定要從群組中移除之使用者或群組的唯一物件標識碼。

類型:Guid
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-GroupMemberType

指定要從群組中移除的成員類型。 有效值為:使用者和群組。

類型:GroupMemberType
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-GroupObjectId

指定要從中移除成員之群組的唯一標識碼。

類型:Guid
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-TenantId

指定要在其中執行作業之租使用者的唯一標識符。 預設值為目前使用者的租使用者。 此參數僅適用於合作夥伴使用者。

類型:Guid
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False