Remove-EntraUser

删除用户。

语法

Default (默认值)

Remove-EntraUser

    -UserId <String>
    [<CommonParameters>]

说明

Remove-EntraUser cmdlet 删除Microsoft Entra ID中的用户。 指定要UserId在Microsoft Entra ID中删除指定用户的参数。

呼叫用户必须至少分配以下Microsoft Entra角色之一:

  • 用户管理员
  • 特权身份验证管理员

示例

示例 1:删除用户

Connect-Entra -Scopes 'User.ReadWrite.All'
Remove-EntraUser -UserId 'SawyerM@Contoso.com'

此命令删除Microsoft Entra ID中的指定用户。

示例 2:基于搜索结果删除用户

Connect-Entra -Scopes 'User.ReadWrite.All'
Get-EntraUser -UserId 'SawyerM@Contoso.com' | Remove-EntraUser

此命令删除Microsoft Entra ID中的指定用户。

参数

-UserId

指定Microsoft Entra ID中用户(作为 UPN 或 UserId)的 ID。

参数属性

类型: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