Remove-CMDevice

Removes a client device from Configuration Manager.

Syntax

Remove-CMDevice
      [-InputObject] <IResultObject>
      [-Force]
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-CMDevice
      [-Name] <String>
      [-Force]
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-CMDevice
      [-ResourceId] <Int32>
      [-Force]
      [-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

Configuration Manager cmdlets must be run from the Configuration Manager site drive. The examples in this article use the site name XYZ. For more information, see the getting started documentation.

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
Accept pipeline input:False
Accept wildcard characters:False
-DisableWildcardHandling

DisableWildcardHandling treats wildcard characters as literal character values. Cannot be combined with ForceWildcardHandling.

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

ForceWildcardHandling processes wildcard characters and may lead to unexpected behavior (not recommended). Cannot be combined with DisableWildcardHandling.

Type:SwitchParameter
Position:Named
Default value:None
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
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Name

Specifies the name of a device.

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

Specifies the resource ID of a device.

Type:Int32
Aliases:Id, DeviceId
Position:0
Default value:None
Accept pipeline input:False
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
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

Outputs

System.Object