Remove-CMDevice

Removes a client device from Configuration Manager.

Syntax

Remove-CMDevice
      [-Force]
      [-InputObject] <IResultObject>
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-CMDevice
      [-Force]
      [-Name] <String>
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-CMDevice
      [-Force]
      [-ResourceId] <Int32>
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Remove-CMDevice cmdlet removes one or more Configuration Manager client devices. Do not remove a client if you want to uninstall the client or remove it from a collection.

Note

Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>. For more information, see getting started.

Examples

Example 1: Remove a device by name

PS XYZ:\> Remove-CMDevice -DeviceName "WIN10-86-33"

This command removes the device named WIN10-86-33.

Example 2: Get a device and remove it

PS XYZ:\> Get-CMDevice -Name "TestVLAN-VNEXT" | Remove-CMDevice

This command gets the device object named TestVLAN-VNEXT and uses the pipeline operator to pass the object to Remove-CMDevice, which removes the device object.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

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

-DisableWildcardHandling

This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
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

-ForceWildcardHandling

This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.

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

-InputObject

Specifies a device object. To obtain a device object, use the Get-CMDevice cmdlet.

Type:IResultObject
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Name

Specifies the name of a device.

Type:String
Aliases:DeviceName
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:True

-ResourceId

Specifies the resource ID of a device.

Type:Int32
Aliases:Id, DeviceId
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet doesn't run.

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

Inputs

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

Outputs

System.Object