PowerCLI Reference

Disconnect-Vmc

Synopsis

This cmdlet closes the connection to the servers specified by the Server parameter.

Syntax

Disconnect-Vmc [[-Server] <CisServer[]>] [-Force] [-Confirm] [-WhatIf] [<CommonParameters>]

Related Commands

Online Version
Connect-Vmc

Detailed Description

This cmdlet closes the connection to the servers specified by the Server parameter.


When no servers are specified and if there is only one connected server in the $defaultVmcServers variable, this server is disconnected. If there is no connected server, the cmdlet throws a non-terminating error.


This functionality is using the reference counting mechanism. For more information about the mechanism, see Connect-Vmc.


When there are no more active connections to the server, it gets disconnected and then it is removed from the $defaultVmcServers variable (if it is present). For more information about this variable, see Connect-Vmc.


If the Force parameter is specified, the server is disconnected even if there is more than one connection to it. The RefCount property of the object is incremented by one.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
ServerCisServer[]Specifies the VMware Cloud on AWS servers you want to disconnect from.falseTrue (ByValue)
ConfirmSwitchParameterIf the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation.falseFalse
ForceSwitchParameterSpecifies that you want to remove all existing connections to the specified VMware Cloud on AWS servers.falseFalse
WhatIfSwitchParameterIndicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falseFalse

Return Type

None

Notes

Examples

-------------------------- Example 1 --------------------------

$connection = ConnectVmc -RefreshToken $myRefreshToken
Disconnect-Vmc -Server $connection -Confirm:$false

Disconnects the specified VMware Cloud on AWS server without asking for confirmation.

-------------------------- Example 2 --------------------------

$connection = ConnectVmc -RefreshToken $myRefreshToken
Disconnect-Vmc -Server '*' -Force -Confirm:$false

Forces the disconnect operation for all connected VMware Cloud on AWS servers without asking for confirmation.


Copyright © VMware, Inc. All rights reserved.