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] [-WhatIf] [-Confirm] [<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.