Remove-CMDevice

Removes a client device from Configuration Manager.

Syntax

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

Description

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

Examples

Example 1: Remove a device by name

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

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

Example 2: Get a device and remove it

PS C:\> 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.

Required Parameters

-InputObject

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

Type:IResultObject
Required:True
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
Required:True
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
Required:True
Position:0
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

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

Indicates that wildcard handling is disabled.

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

Indicates that wildcard handling is enabled.

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