Set-CMComputerAssociation
Changes settings for a computer association in Configuration Manager.
Syntax
Set-CMComputerAssociation
[-AddMigrationUserName <String[]>]
-DestinationComputer <String>
[-MigrationBehavior <MigrationBehavior>]
[-RemoveMigrationUserName <String[]>]
-SourceComputer <String>
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-CMComputerAssociation
[-AddMigrationUserName <String[]>]
[-MigrationBehavior <MigrationBehavior>]
-MigrationId <String>
[-RemoveMigrationUserName <String[]>]
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Set-CMComputerAssociation cmdlet changes settings for a computer association used for migration. 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, 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 Configuration Manager includes other user names from the source computer.
Note
Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>
. For more information, see getting started.
Examples
Example 1: Modify a computer association
PS XYZ:\> 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.
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 |
Required: | False |
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 |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DestinationComputer
Specifies the name of a destination computer.
Type: | String |
Aliases: | RestoreName |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DisableWildcardHandling
This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ForceWildcardHandling
This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
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 |
Accepted values: | CaptureAndRestoreAllUserAccounts, CaptureAllUserAccountsAndRestoreSpecifiedAccounts, CaptureAndRestoreSpecifiedUserAccounts |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-MigrationId
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
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 |
Required: | False |
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 |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet doesn't run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
None
Outputs
System.Object