Remove-MsolUser

從 Azure Active Directory 移除使用者。

Syntax

Remove-MsolUser
      -ObjectId <Guid>
      [-RemoveFromRecycleBin]
      [-Force]
      [-TenantId <Guid>]
      [<CommonParameters>]
Remove-MsolUser
      [-RemoveFromRecycleBin]
      [-Force]
      -UserPrincipalName <String>
      [-TenantId <Guid>]
      [<CommonParameters>]

Description

Remove-MsolUser Cmdlet 可用來從 Azure Active Directory 移除使用者。 此 Cmdlet 會刪除使用者、其授權,以及任何其他相關聯的資料。

範例

範例 1:移除使用者

Remove-MsolUser -UserPrincipalName "davidchew@contoso.com"

此命令會從 Azure Active Directory 移除使用者 davidchew@contoso.com 。 如果使用者有任何授權,Cmdlet 會移除這些授權。 命令會提示您確認作業。

範例 2:移除使用者而不確認

Remove-MsolUser -UserPrincipalName "davidchew@contoso.com" -Force

此命令會 davidchew@contoso.com 從 Azure Active Directory 中移除。 如果使用者有任何授權,Cmdlet 會移除這些授權。

範例 3:從回收站移除使用者

Remove-MsolUser -UserPrincipalName "davidchew@contoso.com" -RemoveFromRecycleBin

此命令會 davidchew@contoso.com 從 Azure Active Directory 回收站中移除。 命令會提示您確認作業。 此命令會永久移除使用者。

參數

-Force

表示此 Cmdlet 不會提示您進行確認。

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ObjectId

指定要移除之使用者的唯一物件識別碼。

Type:Guid
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-RemoveFromRecycleBin

表示此 Cmdlet 會永久從回收站移除已刪除的使用者。 此作業只能套用至已刪除的使用者。 當此作業完成時,您將無法使用 Restore-MsolUser Cmdlet 來復原使用者。

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-TenantId

指定要執行作業之租使用者的唯一識別碼。 預設值是目前使用者的租使用者。 此參數僅適用于合作夥伴使用者。

Type:Guid
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-UserPrincipalName

指定要移除之使用者的使用者主體名稱。

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