PowerCLI Reference

Disconnect-SrmServer

Synopsis

This cmdlet closes the connection to one or more vCenter Site Recovery Manager (SRM) servers.

Syntax

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

Related Commands

Online Version
Connect-SrmServer

Detailed Description

This cmdlet logs out and closes the connection to one or more SRM servers. In PowerCLI, you can have multiple connections to a server. In order to disconnect from a server, you must close all active connections to it. By default, Disconnect-SrmServer closes only the last connection to the specified server. To close all active connections to a server, use the Force parameter or run the cmdlet for each connection.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
ServerSrmServer[]Specifies the SRM 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 SRM server and disconnect from it. If the value is $false, the cmdlet closes only the last connection to the specified server and you must run Disconnect-SrmServer for each active connection to this server in order to 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

None

Notes

Examples

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

Disconnect-SrmServer -Server '*' -Force

Disconnects all SRM server connections.

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

$srmServer = Connect-SrmServer -SrmServerAddress "mySrmServerIp" -User "mySrmUSer" -Password "mySrmPassword"
Disconnect-SrmServer -Server $srmServer

Connects to a specified SRM server by passing the local site credentials for login and then invokes the cmdlet to disconnect from the that server.

-------------------------- Example 3 --------------------------

Disconnect-SrmServer -Server $global:DefaultSrmServers -Force

Logs out and closes all connections to the SRM servers included in the default list of connections established to SRM servers.


Copyright © VMware, Inc. All rights reserved.