Remove-MsolDevice

Remove a device object from Azure Active Directory.

Syntax

Remove-MsolDevice
      -DeviceId <Guid>
      [-Force]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-MsolDevice
      [-Force]
      -ObjectId <Guid>
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Remove-MsolDevice cmdlet removes a device object from Azure Active Directory.

Examples

Example 1: Remove a device by device ID with confirmation

PS C:\> Remove-MsolDevice -DeviceId "aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb"

This command removes the device with DeviceId aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb from Azure Active Directory. Since the command does not use the Force parameter, the user is prompted for confirmation.

Example 2: Remove a device by device ID

PS C:\> Remove-MsolDevice -DeviceId "aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb" -Force

This command removes the device with DeviceId aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb from Azure Active Directory. Since the command uses the Force parameter, the user is not prompted for confirmation.

Example 3: Remove a device by object ID

PS C:\> Remove-MsolDevice -ObjectId "aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb"

This command removes the device with ObjectId aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb from Azure Active Directory.

Parameters

-Confirm

Prompts you for confirmation before running the command.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DeviceId

Specifies the device ID of the device that this cmdlet removes.

Type:Guid
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Force

Forces the command to run without asking for user confirmation.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ObjectId

Specifies the unique object ID of the device that this cmdlet removes.

Type:Guid
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.Online.Administration.Device, System.Guid

You can pipe Microsoft.Online.Administration.Device objects that contain an ObjectId or DeviceId. You can also pipe a device, ObjectId, or DeviceId as a string.

Outputs

This cmdlet does not generate any output.