Set-CMComputerAssociation

Changes settings for a computer association in Configuration Manager.

Syntax

Set-CMComputerAssociation
   -DestinationComputer <String>
   -SourceComputer <String>
   [-MigrationBehavior <MigrationBehavior>]
   [-AddMigrationUserName <String[]>]
   [-RemoveMigrationUserName <String[]>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMComputerAssociation
   -MigrationId <String>
   [-MigrationBehavior <MigrationBehavior>]
   [-AddMigrationUserName <String[]>]
   [-RemoveMigrationUserName <String[]>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The Set-CMComputerAssociation cmdlet changes settings for a computer association used for migration. Microsoft System Center Configuration Manager can migrate user state and settings from an existing computer to a different computer as part of operating system deployment. In the course of migration, System Center Configuration Manager saves accounts created on the source computer and creates those user accounts on the destination computer.

A computer association contains the user names to be migrated and how to deal with other user names from the source computer. You can use this cmdlet to modify an association. You can add user names to the association, or remove user names. You can also change whether System Center Configuration Manager includes other user names from the source computer.

Examples

Example 1: Modify a computer association

PS C:\> Set-CMComputerAssociation -DestinationComputer "TSQA155" -SourceComputer "TSQA073" -AddMigrationUserName "ContosoTSQA\EvanNarvaez" -MigrationBehavior CaptureAllUserAccountsAndRestoreSpecifiedAccounts -RemoveMigrationUserName "ContosoTSQA\ElisaDaugherty"

This command changes the association between the computer named TSQA073 and TSQA155. The command adds the user ContosoTSQA\EvanNarvaez and removes the user ContosoTSQA\ElisaDaugherty. The command specifies the migration behavior as CaptureAllUserAccountsAndRestoreSpecifiedAccounts, so the association causes the migration to save all accounts created on the source computer, but only to create the accounts specified by the computer association on the destination computer.

Required Parameters

-DestinationComputer

Specifies the name of a destination computer.

Type:String
Aliases:RestoreName
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-MigrationId
Type:String
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
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-AddMigrationUserName

Specifies an array of user names for accounts created on the source computer. The cmdlet adds these user names to the current specified user names of the computer association.

Type:String[]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-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
-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
-MigrationBehavior

Specifies how Configuration Manager treats user accounts created on the source computer. When you create a computer association, specify user accounts created on the source computer by using the MigrationUserName parameter of the New-CMComputerAssociation cmdlet. The computer association can specify that the migration process creates some or all of those accounts on the destination computer.

The acceptable values for this parameter are:

  • CaptureAllUserAccountsAndRestoreSpecifiedAccounts. Saves all accounts created on the source computer, but creates only the specified accounts on the destination computer.
  • CaptureAndRestoreAllUserAccounts. Saves all accounts created on the source computer, and creates them on the destination computer.
  • CaptureAndRestoreSpecifiedUserAccounts. Saves only the specified accounts from the source computer, and creates those accounts on the destination computer.
Type:MigrationBehavior
Parameter Sets:CaptureAndRestoreAllUserAccounts, CaptureAllUserAccountsAndRestoreSpecifiedAccounts, CaptureAndRestoreSpecifiedUserAccounts
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RemoveMigrationUserName

Specifies an array of user names for accounts created on the source computer. The cmdlet removes these user names from current specified user names of the computer association.

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