共用方式為


Remove-AzureRmADGroupMember

從 AD 群組移除使用者。

警告

自 2024 年 2 月 29 日起,AzureRM PowerShell 模組已正式淘汰。 建議使用者從 AzureRM 遷移至 Az PowerShell 模組,以確保持續支援和更新。

雖然 AzureRM 模組可能仍可運作,但不再維護或支援它,但會根據用戶的判斷權和風險放置任何繼續使用。 如需轉換至 Az 模組的指引,請參閱我們的 移轉資源

語法

Remove-AzureRmADGroupMember
      [-PassThru]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzureRmADGroupMember
      -MemberObjectId <Guid[]>
      -GroupDisplayName <String>
      [-PassThru]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzureRmADGroupMember
      -MemberObjectId <Guid[]>
      -GroupObject <PSADGroup>
      [-PassThru]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzureRmADGroupMember
      -MemberObjectId <Guid[]>
      -GroupObjectId <Guid>
      [-PassThru]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzureRmADGroupMember
      -MemberUserPrincipalName <String[]>
      -GroupDisplayName <String>
      [-PassThru]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzureRmADGroupMember
      -MemberUserPrincipalName <String[]>
      -GroupObject <PSADGroup>
      [-PassThru]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzureRmADGroupMember
      -MemberUserPrincipalName <String[]>
      -GroupObjectId <Guid>
      [-PassThru]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

從 AD 群組移除使用者。

範例

範例 1 - 依物件識別碼從群組中移除使用者

PS C:\> Remove-AzureRmADGroup -MemberObjectId D9076BBC-D62C-4105-9C78-A7F5BC4A3405 -GroupObjectId 85F89C90-780E-4AA6-9F4F-6F268D322EEE

從物件標識符為 '85F89C90-780E-780E-4AA6-9F268D322EEE' 的群組中移除物件標識符為 'D9076BBC-D62C-4105-9C78-A7F5BC4A3405' 的使用者。

範例 2 - 透過管線從群組中移除使用者

PS C:\> Get-AzureRmADGroup -ObjectId 85F89C90-780E-4AA6-9F4F-6F268D322EEE | Remove-AzureRmADGroupMember -MemberObjectId D9076BBC-D62C-4105-9C78-A7F5BC4A3405

取得對象標識碼為 '85F89C90-780E-4AA6-9F4F-6F268D322EEE' 的群組,並將它傳送至 Remove-AzureRmADGroupMember Cmdlet,以將使用者移除至該群組。

參數

-Confirm

執行 Cmdlet 之前先提示您確認。

類型:SwitchParameter
別名:cf
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-DefaultProfile

用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。

類型:IAzureContextContainer
別名:AzureRmContext, AzureCredential
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-GroupDisplayName

要從中移除成員之群組的顯示名稱。

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

-GroupObject

要從中移除成員之群組的物件表示。

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

-GroupObjectId

要從中移除成員之群組的物件標識碼。

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

-MemberObjectId

成員的物件識別碼。

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

-MemberUserPrincipalName

要移除之成員的UPN。

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

-PassThru

如果命令成功,則指定這會傳回 true。

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

-WhatIf

顯示執行 Cmdlet 後會發生的情況。 未執行 Cmdlet。

類型:SwitchParameter
別名:wi
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

輸入

PSADGroup

參數:GroupObject (ByValue)

輸出

Boolean