New-CMComputerAssociation

Creates an association between two computers in Configuration Manager.

Syntax

New-CMComputerAssociation
   [-Confirm]
   -DestinationComputer <String>
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-MigrationBehavior <MigrationBehavior>]
   [-MigrationUserName <String[]>]
   -SourceComputer <String>
   [-WhatIf]
   [<CommonParameters>]

Description

The New-CMComputerAssociation cmdlet creates an association between two computers to use 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.

To create an association, specify the source computer, the destination computer, and at least one user name created on the source computer to be migrated. You can also specify whether the migration includes other user names from the source computer.

Examples

Example 1: Create a computer association

PS C:\> New-CMComputerAssociation -SourceComputer "TSQA073" -MigrationUserName "Contoso-TSQA\ElisaDaugherty" -DestinationComputer "TSQA155"

This command creates a computer association between the source computer named TSQA073 and the destination computer named TSQA155. The command specifies a user name for migration to the destination computer.

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
-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
-ForceWildcardHandling

Indicates that wildcard handling is enabled.

Type:SwitchParameter
Required:False
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. 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.

    If you do not specify a migration behavior, the migration uses CaptureAndRestoreAllUserAccounts.
Type:MigrationBehavior
Parameter Sets:CaptureAndRestoreAllUserAccounts, CaptureAllUserAccountsAndRestoreSpecifiedAccounts, CaptureAndRestoreSpecifiedUserAccounts
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-MigrationUserName

Specifies an array of user names for accounts created on the source computer. The specified user names, along with the MigrationBehavior parameter setting, determine which user accounts Configuration Manager creates on the destination computer.

Type:String[]
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