Remove-MsolUser
從 Azure Active Directory 移除使用者。
語法
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 不會提示您進行確認。
類型: | SwitchParameter |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-ObjectId
指定要移除之使用者的唯一物件標識碼。
類型: | Guid |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-RemoveFromRecycleBin
表示此 Cmdlet 會從回收站永久移除已刪除的使用者。 此作業只能套用至已刪除的使用者。 完成此作業之後,您將無法使用 Restore-MsolUser Cmdlet 來復原使用者。
類型: | SwitchParameter |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-TenantId
指定要在其中執行作業之租使用者的唯一標識符。 預設值為目前使用者的租使用者。 此參數僅適用於合作夥伴使用者。
類型: | Guid |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-UserPrincipalName
指定要移除之用戶的用戶主體名稱。
類型: | String |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |