PowerCLI Reference

Connect-SrmServer

Synopsis

This cmdlet establishes a connection to a vCenter Site Recovery Manager (SRM) server.

Syntax

Connect-SrmServer [-User <String>] [-Password <SecureString>] [-Port <Int32>] [-Protocol <String>] [-Credential <PSCredential>] [-RemoteCredential <PSCredential>] [-RemoteUser <String>] [-RemotePassword <SecureString>] [-NotDefault] [-IgnoreCertificateErrors] [-Server <VIServer[]>] [<CommonParameters>]
Connect-SrmServer [-User <String>] [-Password <SecureString>] [-SrmServerAddress] <String> [-Port <Int32>] [-Protocol <String>] [-Credential <PSCredential>] [-RemoteCredential <PSCredential>] [-RemoteUser <String>] [-RemotePassword <SecureString>] [-NotDefault] [-Locale <String>] [-IgnoreCertificateErrors] [<CommonParameters>]

Related Commands

Online version
Disconnect-SrmServer

Detailed Description

This cmdlet establishes a connection to an SRM server. To access the SRM API, use the ExtensionData property of the output of this command.

The resulting connections are added to the list of default connections in a global variable named "$global:DefaultSrmServers" (if the NotDefault switch was not specified).

If you are already connected to a vCenter Server system, you can connect to its corresponding SRM server by passing that connection to the Server parameter (see Example 1). If you call Connect-SrmServer and do not specify which server to connect to, the cmdlet uses the default vSphere connections.

To connect to an SRM server without connecting its corresponding vCenter Server first, use the SrmServerAddress parameter.

An SRM deployment typically consists of two sites ? a protected site and protecting site. Certain operations require that the session is logged to both sites. To create such a session, specify the RemoteCredential parameter. Some operations are valid for execution only at a protected or protecting site. For those cases, establish the session to that site by specifying the SRM server address at that site to the SrmServerAddress parameter or passing a connection to the vSphere server at that site to the Server parameter.

For more information about SRM API operations, see the SRM API reference guide installed with PowerCLI.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
SrmServerAddressStringSpecifies the IP address or fully qualified domain name (FQDN) of the SRM server.truefalse
CredentialPSCredentialSpecifies the credentials to be used to log in to the SRM server. This parameter is an alternative to the user/password pair of parameters.falsefalse
IgnoreCertificateErrorsSwitchParameterIf specified, any errors related to a bad server certificate of the SRM server are ignored.falsefalse
LocaleStringIf specified, defines the locale of the strings produced by the server for this connection.falsefalse
NotDefaultSwitchParameterIf specified, the resulting connection is not listed in the list of default connections to SRM servers and must be manually specified when used with a cmdlet.falsefalse
PasswordSecureStringSpecifies the password for the connection to the SRM server.falsefalse
PortInt32Specifies the port on the server you want to use for the connection. If not specified, a protocol-specific default value is used.falsefalse
ProtocolStringSpecifies the Internet protocol you want to use for the connection. It can be either HTTP or HTTPS. If not specified, HTTPS is used.falsefalse
RemoteCredentialPSCredentialSpecifies the credentials for a remote SRM server.falsefalse
RemotePasswordSecureStringSpecifies the password for the connection to the remote SRM server.falsefalse
RemoteUserStringSpecifies the user name that is used to log on in to the remote SRM server.falsefalse
ServerVIServer[]Specifies the vCenter Server system that the SRM server is associated to. If no value is given to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.falsetrue (ByValue)
UserStringSpecifies the user name that is used to log in to the SRM server.falsefalse

Return Type

SrmServer

Notes

Examples

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

Connect-VIServer "myVCServerIp" -User "myUser" -Password "myPassword"
Connect-SrmServer

Connects to a vCenter Server system, that has an SRM server associated with it. Then, invokes the cmdlet without specifying any parameters to establish a connection to the SRM server registered with the connected vCenter Server system. If you have previously connected to other vCenter Server systems configured with SRM server support, this cmdlet invocation will establish a connection to their corresponding SRM servers as well.

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

Connect-SrmServer -SrmServerAddress 192.0.2.1 -User "myUser" -Password "myPassword"

Connects to an SRM server with an IP address of 192.0.2.1 by passing a valid user name and password.

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

Connect-VIServer "myVCServerIp" -User "myUser" -Password "myPassword"
Connect-SrmServer -RemoteCredential $myRemoteCredential

Connects to a vCenter Server system associated with an SRM server. Then, establishes a connection to that SRM server by passing valid credentials for connection to the remote SRM server.

-------------- Example 4 --------------

Connect-VIServer "myVCServerIp" -User "myUser" -Password "myPassword"
Connect-SrmServer -NotDefault -IgnoreCertificateErrors

Connects to a vCenter Server system, that has an associated SRM server. Then, establishes an SRM server connection by ignoring any errors related to bad server certificates. The newly created SRM server connection is not added to the default list of SRM server connections.


Copyright © VMware, Inc. All rights reserved.