Remove-EntraDeviceRegisteredUser

从设备中删除已注册的用户。

语法

Default (默认值)

Remove-EntraDeviceRegisteredUser

    -DeviceId <String>
    -UserId <String>
    [<CommonParameters>]

说明

Remove-EntraDeviceRegisteredUser cmdlet 从Microsoft Entra ID设备中删除已注册的用户。

在涉及工作或学校帐户的委托方案中,登录用户必须具有受支持的Microsoft Entra角色或具有所需权限的自定义角色。 此操作支持以下最低特权角色:

  • Intune 管理员
  • Windows 365 管理员

示例

示例 1:从设备中删除已注册的用户

Connect-Entra -Scopes 'Directory.AccessAsUser.All'
$device = Get-EntraDevice -Filter "DisplayName eq 'Woodgrove Desktop'"
$user = Get-EntraDeviceRegisteredUser -DeviceId $device.Id | Where-Object {$_.userPrincipalName -eq 'parker@contoso.com'}
Remove-EntraDeviceRegisteredUser -DeviceId $device.Id -UserId $user.Id

此示例演示如何从设备中删除已注册的用户。

参数

-DeviceId

指定对象的 ID。

参数属性

类型:System.String
默认值:None
支持通配符:False
不显示:False
别名:对象标识符 (ObjectId)

参数集

(All)
Position:Named
必需:True
来自管道的值:True
来自管道的值(按属性名称):True
来自剩余参数的值:False

-UserId

指定用户的 ID。

参数属性

类型:System.String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:True
来自管道的值:True
来自管道的值(按属性名称):True
来自剩余参数的值:False

CommonParameters

此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters