Remove-EntraUser
移除一個使用者。
語法
Default (預設值)
Remove-EntraUser
-UserId <String>
[<CommonParameters>]
Description
該Remove-EntraUser指令小程式會移除 Microsoft Entra ID 中的使用者。 在 Microsoft Entra ID 中指定UserId移除指定使用者的參數。
來電使用者必須至少被指派以下一項 Microsoft Entra 角色:
- 使用者管理員
- 特殊權限驗證管理員
範例
範例 1:移除使用者
Connect-Entra -Scopes 'User.ReadWrite.All'
Remove-EntraUser -UserId 'SawyerM@Contoso.com'
此指令會移除 Microsoft Entra ID 中指定的使用者。
範例二:根據搜尋結果移除使用者
Connect-Entra -Scopes 'User.ReadWrite.All'
Get-EntraUser -UserId 'SawyerM@Contoso.com' | Remove-EntraUser
此指令會移除 Microsoft Entra ID 中指定的使用者。
參數
-UserId
指定 Microsoft Entra ID 中使用者的 ID(作為 UPN 或 UserID)。
參數屬性
| 類型: | System.String |
| 預設值: | None |
| 支援萬用字元: | False |
| 不要顯示: | False |
| 別名: | ObjectId (物件識別碼), UPN, Identity, 使用者主要名稱 (UserPrincipalName) |
參數集
(All)
| Position: | Named |
| 必要: | True |
| 來自管線的值: | True |
| 來自管線按屬性名稱的值: | True |
| 來自剩餘引數的值: | False |
CommonParameters
此 Cmdlet 支援一般參數:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 如需詳細資訊,請參閱 about_CommonParameters。