< Back

Disconnect-CisServer

Sun Jan 19, 2020 6:47 pm

NAME Disconnect-CisServer



SYNOPSIS

This cmdlet closes the connection to one or more vSphere Automation SDK servers.





SYNTAX

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





DESCRIPTION

This cmdlet closes the connection to one or more vSphere Automation SDK servers.



When no servers and no user name are specified, and if there is only one connected server in $DefaultCisServers

variable, this server is disconnected. If there is no connected server, the cmdlet throws a terminating error.



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

Connect-CisServer.



When there are no more active connections to the server it gets disconnected and then it is removed from the

$DefaultCisServers variable. For more information about this variable, see Connect-CisServer.



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





PARAMETERS

-Force [<SwitchParameter>]

Specifies that you want to remove all existing connections to the specified servers.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Server <CisServer[]>

Specifies the vSphere Automation SDK servers you want to disconnect from.



Required? false

Position? 1

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? true



-Confirm [<SwitchParameter>]

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



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are

modified.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

None







NOTES









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



$server = Connect-CisServer -Server 'server_name' -User 'user@domain' -Password 'user_password'

Disconnect-CisServer $server -Confirm:$false



Disconnects the specified vSphere Automation SDK server without asking for confirmation.

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



Connect-CisServer -Server 'server_name' -User 'user@domain' -Password 'user_password'

Connect-CisServer -Server 'server2_name' -User 'user@domain' -Password 'user_password'

Disconnect-CisServer * -Confirm:$false



Disconnects all connected vSphere Automation SDK servers without asking for confirmation.



RELATED LINKS

Online Version: https://code.vmware.com/doc/preview?id= ... erver.html

Connect-CisServer