PowerCLI Reference

Disconnect-HCXServer

Synopsis

This cmdlet closes the connection to one or more HCX servers.

Syntax

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

Related Commands

Detailed Description

This cmdlet closes the connection to one or more HCX servers.


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


This functionality uses the reference counting mechanism. For more information about the mechanism, see the Connect-HCXServer cmdlet.


When there are no active connections to the server, it gets disconnected and is removed from the $DefaultHCXServers variable. For more information about this variable, see the Connect-HCXServer cmdlet.


If the -Force parameter is specified, the server disconnects even if there is more than one connection to it.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
ServerCisServer[]Specifies the HCX 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
ForceSwitchParameterIndicates that you want to close all active connections to the specified server and disconnect from it.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

System.Void

Notes

Examples

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

$server = Connect-HCXServer -Server 'server_name' -User 'user@domain' -Password 'user_password'
Disconnect-HCXServer $server -Confirm:$false

Disconnects the specified HCX server without asking for confirmation.

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

Connect-HCXServer -Server 'server_name' -User 'user@domain' -Password 'user_password'
Connect-HCXServer -Server 'server2_name' -User 'user@domain' -Password 'user_password'
Disconnect-HCXServer * -Confirm:$false

Disconnects the specified HCX server without asking for confirmation.


Copyright © VMware, Inc. All rights reserved.