New-CMComputerAssociation

New-CMComputerAssociation

Creates an association between two computers in Configuration Manager.

Syntax

Parameter Set: NewComputerAssociation
New-CMComputerAssociation -DestinationComputer <String> -SourceComputer <String> [-MigrationBehavior <MigrationBehavior> {CaptureAllUserAccountsAndRestoreSpecifiedAccounts | CaptureAndRestoreAllUserAccounts | CaptureAndRestoreSpecifiedUserAccounts} ] [-MigrationUserName <String[]> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The New-CMComputerAssociation cmdlet creates an association between two computers to use for migration. Microsoft System Center 2012 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 2012 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.

Parameters

-DestinationComputer<String>

Specifies the name of a destination computer.

Aliases

RestoreName

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-MigrationBehavior<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.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-MigrationUserName<String[]>

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.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-SourceComputer<String>

Specifies the name of the source computer.

Aliases

SourceName

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

Example 1: Create a computer association

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.

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

Get-CMComputerAssociation

Remove-CMComputerAssociation

Set-CMComputerAssociation