Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

Remove-EntraDeviceRegisteredUser

Removes a registered user from a device.

Syntax

Default (Default)

Remove-EntraDeviceRegisteredUser

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

Description

The Remove-EntraDeviceRegisteredUser cmdlet removes a registered user from a Microsoft Entra ID device.

In delegated scenarios involving work or school accounts, the signed-in user must have a supported Microsoft Entra role or a custom role with the required permissions. The following least privileged roles are supported for this operation:

  • Intune Administrator
  • Windows 365 Administrator

Examples

Example 1: Remove a registered user from a device

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

This example shows how to remove the registered user from device.

Parameters

-DeviceId

Specifies the ID of an object.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ObjectId

Parameter sets

-UserId

Specifies the ID of a user.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Related Links


Feedback

Was this page helpful?