Remove-SCComputerConfiguration

Remove-SCComputerConfiguration

Removes a machine configuration object from VMM.

Syntax

Parameter Set: Default
Remove-SCComputerConfiguration [-ComputerConfiguration] <MachineConfiguration> [-Credential <PSCredential> ] [-Force] [-JobVariable <String> ] [-PROTipID <Guid> ] [-RunAsynchronously] [ <CommonParameters>]

Detailed Description

The Remove-SCComputerConfiguration cmdlet removes one or more computer configuration objects from the 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.

Parameters

-ComputerConfiguration<MachineConfiguration>

Specifies a computer configuration object.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-Credential<PSCredential>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-Force

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.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-JobVariable<String>

Specifies that job progress is tracked and stored in the variable named by this parameter.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PROTipID<Guid>

Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

Aliases

none

Required?

false

Position?

named

Default Value

none

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.

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.

Notes

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

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.

PS C:\> $ComputerConfig = Get-SCComputerConfiguration | where { $_.Name -eq "P2VSource01.Contoso.com" }
PS C:\> Remove-SCComputerConfiguration -ComputerConfiguration $ComputerConfig -Force

2: Remove a P2V agent from a specific source computer.

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.

PS C:\> $Credential = Get-Credential
PS C:\> $ComputerConfig = Get-SCComputerConfiguration | where { $_.Name -eq "P2VSource01.Contoso.com" }
PS C:\> Remove-SCComputerConfiguration -ComputerConfiguration $ComputerConfig -Credential $Credential

Get-SCComputerConfiguration

New-SCComputerConfiguration