Edit

Share via


Remove-AzureADDeviceRegisteredUser

Removes a registered user from a device.

Syntax

Default (Default)

Remove-AzureADDeviceRegisteredUser
    -ObjectId <String>
    -UserId <String>
    [<CommonParameters>]

Description

The Remove-AzureADDeviceRegisteredUser cmdlet removes a registered user from an Azure Active Directory device.

Examples

Example 1: Remove a registered user from a device

PS C:\> $Device = Get-AzureADDevice -Top 1
PS C:\> $User = Get-AzureADDeviceRegisteredUser -ObjectId $Device.ObjectId
PS C:\> Remove-AzureADDeviceRegisteredOwner -ObjectId $Device.ObjectId -OwnerId $Owner.ObjectId

The first command gets a device by using the Get-AzureADDevice (./Get-AzureADDevice.md)cmdlet, and then stores it in the $Device variable.

The second command gets the registered user for the device in $Device by using the Get-AzureADDeviceRegisteredUser (./Get-AzureADDeviceRegisteredUser.md)cmdlet. The command stores it in the $User variable.

The final command removes the user in $User from the device in $Device.

Parameters

-ObjectId

Specifies the ID of an object.

Parameter properties

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

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-UserId

Specifies the ID of a user.

Parameter properties

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

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

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.

Notes

See the migration guide for Remove-AzureADDeviceRegisteredUser to the Microsoft Graph PowerShell.