Remove-SCComputerConfiguration

Removes a machine configuration object from VMM.

Description

The Remove-SCComputerConfiguration cmdlet removes one or more computer configuration objects from the System Center Virtual Machine Manager (VMM) database and removes the VMM P2V agent from the physical source computer (if the agent is still installed). 

This cmdlet returns the object upon success (with the property MarkedForDeletion set to TRUE) or returns an error message upon failure.

For more information about Remove-SCComputerConfiguration, type: "Get-Help Remove-SCComputerConfiguration -online".

Parameters

ComputerConfiguration

Required? true
Accept Pipeline Input? true (ByValue)
Position? 0
Specifies a computer configuration object.

Confirm

Required? false
Accept Pipeline Input? false
Position? named
Prompts for confirmation before running the command.

Credential

Required? false
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a credential object or, for some cmdlets, a Run As account object that contains the user name and password of an account that has permission to perform this action. Or, in the case of Restart-SCJob, has permission to complete a restarted task. 

For more information about the PSCredential object, type: "Get-Help Get-Credential". 
For more information about Run As accounts, type: "Get-Help New-SCRunAsAccount".

Force

Required? false
Accept Pipeline Input? false
Position? named
Forces the operation to complete. 

For example:
- Remove-SCSCVMHost -Force
  Forces the removal of a host object from the VMM database.

- Stop-SCVirtualMachine -Force
  Stops a virtual machine.

JobVariable

Required? false
Accept Pipeline Input? false
Position? named
Specifies that job progress is tracked and stored in the variable named by this parameter. 

PROTipID

Required? false
Accept Pipeline Input? false
Position? named
Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

RunAsynchronously

Required? false
Accept Pipeline Input? false
Position? named
Indicates that the job runs asynchronously so that control returns to the command shell immediately. 
Requires a VMM computer configuration object, which can be retrieved by using the Get-SCComputerConfiguration cmdlet.

Examples

1: Remove a specific computer configuration from the VMM database.
PS C:\> $ComputerConfig = Get-SCComputerConfiguration | where { $_.Name -eq "P2VSource01.Contoso.com" }
PS C:\> Remove-SCComputerConfiguration -ComputerConfiguration $ComputerConfig -Force
The first command gets the computer configuration object named P2VSource01.Contoso.com from the VMM database and stores the object in the $ComputerConfig variable.

The second command removes the machine configuration object for P2VSource01.Contoso.com from the VMM database by using the -Force parameter.
2: Remove a P2V agent from a specific source computer.
PS C:\> $Credential = Get-Credential
PS C:\> $ComputerConfig = Get-SCComputerConfiguration | where { $_.Name -eq "P2VSource01.Contoso.com" }
PS C:\> Remove-SCComputerConfiguration -ComputerConfiguration $ComputerConfig -Credential $Credential
The first command uses Get-Credential to prompt you to supply a user name and password and stores your credentials in $Credential. The required credentials for this operation are either a local Administrator account or a domain account with administrator rights on the computer from which you want to gather information. 

The command gets the computer configuration object named P2VSource01.Contoso.com and stores the object in the $ComputerConfig variable. 

The last command removes the P2V agent from P2VSource01.Contoso.com.

See Also