Udostępnij za pośrednictwem


Remove-SCVirtualizationManager

Removes a VMware vCenter Server from VMM.

Syntax

Default (Default)

Remove-SCVirtualizationManager
    [-VirtualizationManager] <VirtualizationManager>
    [-RunAsynchronously]
    [-PROTipID <Guid>]
    [-JobVariable <String>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Remove-SCVirtualizationManager cmdlet removes one or more VMware vCenter Server objects from Virtual Machine Manager (VMM). This cmdlet deletes the vCenter Server object from the VMM database and also removes all imported ESX host objects and virtual machine objects associated with the vCenter Server.

When you remove a VirtualCenter Server, the cmdlet does not make any changes within the vCenter Server and does not remove any hosts or virtual machines from the vCenter Server.

Examples

Example 1: Remove a VMware vCenter Server from VMM

PS C:\> $VirtMgrServer = Get-SCVirtualizationManager -VMMServer "VMMServer01.Contoso.com" -ComputerName "VirtMgrServer01.Contoso.com"
PS C:\> Remove-SCVirtualizationManager -VirtualizationManager $VirtMgrServer

The first command gets the virtualization manager object named VirtMgrServer01 from VMMServer01 and stores the object in the $VirtMgrServer variable.

The second command removes the vCenter Server object, as well as all associated host and virtual machine objects, from VMM.

Example 2: Remove a set of VMware vCenter Servers from VMM

PS C:\> $VirtManagers = Get-SCVirtualizationManager -VMMServer "VMMServer01.Contoso.com" | where { $_.Name -match "Server" }
PS C:\> ForEach ($VirtManager in $VirtManagers) {Remove-SCVirtualizationManager -VirtualizationManager $VirtManager}

The first command gets all virtualization manager objects whose name includes the string "Server" and stores the objects in $VirtManagers.

The second command removes each object in $VirtManagers from VMM, as well as all associated host and virtual machine objects.

For more information about the standard Windows PowerShell ForEach loop statement, type Get-Help about_ForEach.

Example 3: Remove all VMware vCenter Servers from VMM

PS C:\> Get-SCVirtualizationManager | Remove-SCVirtualizationManager -RunAsynchronously

This command removes all virtualization manager objects from VMM.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-JobVariable

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PROTipID

Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.

Parameter properties

Type:Guid
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RunAsynchronously

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-VirtualizationManager

Specifies a virtualization manager object managed by VMM.

Parameter properties

Type:VirtualizationManager
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

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

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Notes

  • Requires a VMM virtualization manager object, which can be retrieved by using the Get-SCVirtualizationManager cmdlet.