Remove-CMComputerAssociation

Deletes a computer association from Configuration Manager.

Syntax

Remove-CMComputerAssociation
      [-Confirm]
      -DestinationComputer <String>
      [-DisableWildcardHandling]
      [-Force]
      [-ForceWildcardHandling]
      -SourceComputer <String>
      [-WhatIf]
      [<CommonParameters>]
Remove-CMComputerAssociation [-Confirm] [-DisableWildcardHandling] [-Force] [-ForceWildcardHandling]
 -InputObject  [-WhatIf] []
Remove-CMComputerAssociation [-Confirm] [-DisableWildcardHandling] [-Force] [-ForceWildcardHandling]
 -MigrationId  [-WhatIf] []

Description

The Remove-CMComputerAssociation cmdlet deletes a computer association from Microsoft System Center Configuration Manager. You can specify the association to remove by specifying both computers in the association or by specifying the association ID, or you can use the Get-CMComputerAssociation cmdlet to get an association to remove.

Examples

Example 1: Remove an association by using computer names

PS C:\> Remove-CMComputerAssociation -DestinationComputer "West155" -SourceComputer "West073"

This command removes the computer association between the computers named West155 and West073.

Example 2: Remove an association by using an ID

PS C:\> Remove-CMComputerAssociation -MigrationId "MID1207" -Force

This command removes the computer association that has the ID MID1207. This command uses the Force parameter, so the cmdlet does not prompt you for confirmation before it removes the association.

Example 3: Remove an association by using a variable

PS C:\> $CMCA = Get-CMComputerAssociation -MigrationId "MID1207"
PS C:\> Remove-CMComputerAssociation -InputObject $CMCA -Force

The first command gets the computer association that has the ID MID1207, and saves it in the $CMCA variable.

The second command removes the association saved in the $CMCA variable. This command uses the Force parameter, so the cmdlet does not prompt you for confirmation before it removes the association.

Required Parameters

-DestinationComputer

Specifies the name of a destination computer.

Type:String
Aliases:RestoreName
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InputObject

Specifies a computer association object. To obtain a computer association object, use the Get-CMComputerAssociation cmdlet.

Type:IResultObject
Required:True
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-MigrationId

Specifies the ID of a computer association.

Type:String
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SourceComputer

Specifies the name of the source computer.

Type:String
Aliases:SourceName
Required:True
Position:Named
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